/* Shared component rules for the new layout. Loaded after every other
   new-layout stylesheet so these win. Colors come from hub-v12-tokens.css.
   Classic layout is unchanged: everything here is under body.hub-v12. */

/* --- Keyboard focus: one visible ring everywhere -------------------------- */
body.hub-v12 button:focus-visible,
body.hub-v12 a:focus-visible,
body.hub-v12 summary:focus-visible,
body.hub-v12 [role="button"]:focus-visible,
body.hub-v12 [tabindex]:focus-visible {
  outline: 2px solid var(--hub-action);
  outline-offset: 2px;
}
body.hub-v12 input:focus-visible,
body.hub-v12 select:focus-visible,
body.hub-v12 textarea:focus-visible {
  outline: none;
  border-color: var(--hub-action);
  box-shadow: var(--hub-focus);
}

/* --- Tap size: at least 44 by 44 on the phone ----------------------------- */
body.hub-v12.v12-phone .ops-primary,
body.hub-v12.v12-phone .ops-secondary,
body.hub-v12.v12-phone .sheet-go,
body.hub-v12.v12-phone .sheet-outline,
body.hub-v12.v12-phone .sheet-action,
body.hub-v12.v12-phone .ops-back,
body.hub-v12.v12-phone .ops-call,
body.hub-v12.v12-phone .ops-tile,
body.hub-v12.v12-phone .sheet-pills button,
body.hub-v12.v12-phone .sheet-filters button,
body.hub-v12.v12-phone .sheet-seg button,
body.hub-v12.v12-phone .sheet-tabs button,
body.hub-v12.v12-phone .v12-bell,
body.hub-v12.v12-phone .v12-phone-back,
body.hub-v12.v12-phone #v12PhoneBar button,
body.hub-v12.v12-phone .v12-more-sheet button {
  min-height: var(--hub-tap);
}
body.hub-v12.v12-phone .v12-bell,
body.hub-v12.v12-phone .v12-phone-back {
  min-width: var(--hub-tap);
}

/* --- Buttons: blue is the action ----------------------------------------- */
body.hub-v12 button.primary,
body.hub-v12 .btn.primary,
body.hub-v12.v12-phone .ops-primary,
body.hub-v12.v12-phone .sheet-go {
  background: var(--hub-action);
  border-color: var(--hub-action);
  color: var(--hub-on-navy);
}
body.hub-v12 button.primary:hover,
body.hub-v12 .btn.primary:hover,
body.hub-v12.v12-phone .ops-primary:hover,
body.hub-v12.v12-phone .sheet-go:hover {
  background: var(--hub-action-d);
  border-color: var(--hub-action-d);
}
body.hub-v12 button.primary:disabled,
body.hub-v12.v12-phone .ops-primary:disabled {
  background: var(--hub-off-l);
  border-color: var(--hub-line-strong);
  color: var(--hub-ink-muted);
}

/* --- Structure: navy menu and phone header -------------------------------- */
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop {
  background: var(--hub-navy);
}

/* --- Status pills: word + color from one scale ---------------------------- */
body.hub-v12 .hub-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
body.hub-v12 .hub-pill.alert { background: var(--hub-alert-l); color: var(--hub-alert); }
body.hub-v12 .hub-pill.progress { background: var(--hub-progress-l); color: var(--hub-progress); }
body.hub-v12 .hub-pill.wait { background: var(--hub-wait-l); color: var(--hub-wait); }
body.hub-v12 .hub-pill.done { background: var(--hub-done-l); color: var(--hub-done); }
body.hub-v12 .hub-pill.off { background: var(--hub-off-l); color: var(--hub-off); }

/* The phone sheets' existing chip tones, mapped onto the same scale. */
body.hub-v12.v12-phone .ops-chip.red,
body.hub-v12.v12-phone .sheet-chip.red,
body.hub-v12.v12-phone .sheet-chip.pink { background: var(--hub-alert-l); color: var(--hub-alert); }
body.hub-v12.v12-phone .ops-chip.blue,
body.hub-v12.v12-phone .sheet-chip.blue { background: var(--hub-progress-l); color: var(--hub-progress); }
body.hub-v12.v12-phone .ops-chip.amber,
body.hub-v12.v12-phone .sheet-chip.amber { background: var(--hub-wait-l); color: var(--hub-wait); }
body.hub-v12.v12-phone .ops-chip.green,
body.hub-v12.v12-phone .sheet-chip.green { background: var(--hub-done-l); color: var(--hub-done); }
body.hub-v12.v12-phone .ops-chip.gray,
body.hub-v12.v12-phone .sheet-chip.gray { background: var(--hub-off-l); color: var(--hub-off); }

/* --- Cards ---------------------------------------------------------------- */
body.hub-v12.v12-phone .ops-card,
body.hub-v12.v12-phone .sheet-card,
body.hub-v12.v12-phone .sheet-job {
  border-color: var(--hub-line);
  border-radius: var(--hub-radius-card);
}

/* --- Phone Today: the Ask bar (Home and Today are one start screen) ------- */
body.hub-v12.v12-phone .v12-today-ask {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin: 4px 0 14px;
  padding: 8px 14px;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
  color: var(--hub-ink);
  text-align: left;
  cursor: pointer;
}
body.hub-v12.v12-phone .v12-today-ask-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--hub-action-l);
  color: var(--hub-action);
  flex-shrink: 0;
}
body.hub-v12.v12-phone .v12-today-ask-copy { display: flex; flex-direction: column; gap: 2px; }
body.hub-v12.v12-phone .v12-today-ask-copy b { font-size: 15px; font-weight: 600; }
body.hub-v12.v12-phone .v12-today-ask-copy small { font-size: 13px; color: var(--hub-ink-muted); }

/* --- Phone jobs: Today / Overdue / Upcoming / Done, Mine / Team ---------- */
body.hub-v12.v12-phone .sheet-pills .pill-count { font-weight: 600; margin-left: 2px; }
body.hub-v12.v12-phone .sheet-pills button.alert { color: var(--hub-alert); background: var(--hub-alert-l); }
body.hub-v12.v12-phone .sheet-pills button.alert.on { border-color: var(--hub-alert); }
body.hub-v12.v12-phone .sheet-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
body.hub-v12.v12-phone .sheet-scope button {
  min-height: var(--hub-tap); border: 1.5px solid transparent; background: var(--hub-line);
  color: var(--hub-ink-muted); border-radius: 999px; font-size: 13px;
}
body.hub-v12.v12-phone .sheet-scope button.on {
  background: var(--hub-action-l); color: var(--hub-action); border-color: var(--hub-action); font-weight: 600;
}

/* --- Phone More sheet: header, grouped grid, footer ----------------------- */
body.hub-v12.v12-phone #v12More .v12-more-sheet {
  background: var(--hub-surface);
  color: var(--hub-ink);
  border-radius: var(--hub-radius-card) var(--hub-radius-card) 0 0;
}
body.hub-v12.v12-phone #v12More .v12-more-sheet header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 8px; border-bottom: 1px solid var(--hub-line);
}
body.hub-v12.v12-phone #v12More .v12-more-sheet header b { font-size: 17px; }
body.hub-v12.v12-phone #v12More #v12MoreClose {
  width: var(--hub-tap); min-height: var(--hub-tap); padding: 0; text-align: center;
  font-size: 24px; line-height: 1; color: var(--hub-ink-muted);
}
body.hub-v12.v12-phone #v12More .v12-more-sheet h3 {
  margin: 16px 4px 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--hub-ink-muted);
}
body.hub-v12.v12-phone #v12More .v12-more-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
body.hub-v12.v12-phone #v12More .v12-more-grid button,
body.hub-v12.v12-phone #v12More .v12-more-foot button {
  min-height: var(--hub-tap); padding: 10px 12px; text-align: left;
  color: var(--hub-ink); background: var(--hub-canvas);
  border: 1px solid var(--hub-line); border-radius: var(--hub-radius);
}
body.hub-v12.v12-phone #v12More .v12-more-foot {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--hub-line);
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
body.hub-v12.v12-phone #v12More .v12-more-foot button { background: var(--hub-surface); }
body.hub-v12.v12-phone #v12More .v12-more-foot button[data-v12-menu="settings"],
body.hub-v12.v12-phone #v12More .v12-more-foot button[data-v12-menu="requests"] { color: var(--hub-action); }

/* --- Desktop: no build marks (phase 3) ------------------------------------ */
/* The version chip stays for its real job: warning when this page and the
   service worker are different deploys. Otherwise it is hidden. */
body.hub-v12 #hubVersionChip:not(.hub-version-warn) { display: none; }
body.hub-v12 #hubV12Nav .v12-chip-mark,
body.hub-v12 #hubV12Nav .v12-legend { display: none; }
body.hub-v12 #hubV12Nav .v12-item.on {
  box-shadow: inset 3px 0 0 var(--hub-action);
}

/* --- Desktop Today: needs-attention number tiles (phase 3) ---------------- */
body.hub-v12 .v12-attn {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
body.hub-v12 .v12-attn-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
  color: var(--hub-ink);
  text-align: left;
  cursor: pointer;
}
body.hub-v12 .v12-attn-tile:hover { border-color: var(--hub-action-line); }
body.hub-v12 .v12-attn-tile b {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
body.hub-v12 .v12-attn-tile span { font-size: 14px; color: var(--hub-ink-muted); }
body.hub-v12 .v12-attn-tile.hot { border-color: var(--hub-alert-l); background: var(--hub-alert-l); }
body.hub-v12 .v12-attn-tile.hot b { color: var(--hub-alert); }

/* Requests page, desktop list + detail (new layout, 1100px and wider). */
body.hub-v12 .req-split {
  display: grid;
  grid-template-columns: minmax(360px, 5fr) 7fr;
  gap: 16px;
  align-items: start;
}
body.hub-v12 .req-split-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
  overflow: hidden;
}
body.hub-v12 .req-split-list:focus-visible { outline: 2px solid var(--hub-action); outline-offset: 2px; }
body.hub-v12 .req-split-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "t pill" "meta pill";
  column-gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--hub-line);
  color: var(--hub-ink);
  cursor: pointer;
}
body.hub-v12 .req-split-list li:last-child { border-bottom: 0; }
body.hub-v12 .req-split-list li:hover { background: var(--hub-canvas); }
body.hub-v12 .req-split-list li[aria-selected="true"] {
  background: var(--hub-action-l);
  box-shadow: inset 3px 0 0 var(--hub-action);
}
body.hub-v12 .req-split-list .req-t {
  grid-area: t;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.hub-v12 .req-split-list .req-m {
  grid-area: meta;
  font-size: 13px;
  color: var(--hub-ink-muted);
}
body.hub-v12 .req-split-list .hub-pill { grid-area: pill; justify-self: end; }
body.hub-v12 .req-split-detail {
  position: sticky;
  top: 16px;
  min-height: 120px;
  border-radius: var(--hub-radius-card);
}

/* --- Request lanes as filter chips (phase 3b) ------------------------------ */
body.hub-v12 .v12-lanes button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hub-line);
  border-radius: 999px;
  background: var(--hub-surface);
  color: var(--hub-ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
body.hub-v12 .v12-lanes button:hover { border-color: var(--hub-action-line); }
body.hub-v12 .v12-lanes button.on {
  background: var(--hub-navy);
  border-color: var(--hub-navy);
  color: var(--hub-on-navy);
}

/* ---- Jobs / Field View on a wide desktop: list left, selected job right ----
   Only the new layout, only the desktop. field.js draws the two panes under
   the same gate, so a phone or a narrow window never meets these rules. */
body.hub-v12 .fsplit {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 16px;
  height: calc(100vh - 140px);
  min-height: 420px;
}
body.hub-v12 .fsplit-list,
body.hub-v12 .fsplit-detail {
  min-width: 0;
  overflow-y: auto;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
}
body.hub-v12 .fsplit-detail { background: var(--hub-canvas); position: relative; }
body.hub-v12 .fsplit .fw {
  max-width: none;
  margin: 0;
  padding: 14px;
}
body.hub-v12 .fsplit .fw.task { padding-top: 8px; padding-bottom: 0; }
body.hub-v12 .fsplit .fbar {
  position: sticky;
  left: auto;
  right: auto;
  bottom: 0;
  max-width: none;
  margin: 14px -14px 0;
}
body.hub-v12 .fsplit .fsegs { flex-wrap: wrap; }
body.hub-v12 .fsplit .fcard.selected,
body.hub-v12 .fsplit .fcard[aria-current="true"] {
  background: var(--hub-action-l);
  box-shadow: inset 4px 0 0 var(--hub-action);
}
body.hub-v12 .fsplit .fcard:focus-visible {
  outline: 2px solid var(--hub-action);
  outline-offset: -2px;
}
body.hub-v12 .fsplit-empty {
  margin: 0;
  padding: 40px 20px;
  text-align: center;
  color: var(--hub-ink-muted);
}

/* Section tabs: tie related pages together (Properties, Help & feedback). */
body.hub-v12 .hub-sections {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hub-line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
body.hub-v12 .hub-sections button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--hub-ink-muted);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
body.hub-v12 .hub-sections button:hover { color: var(--hub-ink); }
body.hub-v12 .hub-sections button.on {
  color: var(--hub-ink);
  border-bottom-color: var(--hub-action);
}
body.hub-v12 .hub-sections button:focus-visible { outline: none; box-shadow: var(--hub-focus); }

/* Showings: one page, Mine / All switch. Agents get no switch. */
body.hub-v12 .show-scope {
  display: flex;
  max-width: 320px;
  margin: 0 0 14px;
}
body.hub-v12 .show-scope-btn {
  flex: 1 1 0;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--hub-surface);
  color: var(--hub-ink);
  border: 1px solid var(--hub-line);
}
body.hub-v12 .show-scope-btn:first-child { border-radius: 10px 0 0 10px; }
body.hub-v12 .show-scope-btn:last-child { border-radius: 0 10px 10px 0; margin-left: -1px; }
body.hub-v12 .show-scope-btn.on {
  background: var(--hub-navy);
  color: var(--hub-on-navy);
  border-color: var(--hub-navy);
}
body.hub-v12 .show-scope-btn:focus-visible {
  outline: 2px solid var(--hub-action);
  outline-offset: 2px;
}

/* Money landing: one tile per queue, count only when known (phase 4). */
body.hub-v12 .acct-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0 0;
}
body.hub-v12 .acct-tiles .acct-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
  color: var(--hub-ink);
  text-align: left;
  cursor: pointer;
}
body.hub-v12 .acct-tiles .acct-tile:hover { border-color: var(--hub-action-line); }
body.hub-v12 .acct-tiles .acct-tile b {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
body.hub-v12 .acct-tiles .acct-tile strong { font-size: 15px; font-weight: 600; }
body.hub-v12 .acct-tiles .acct-tile span { font-size: 14px; color: var(--hub-ink-muted); }
body.hub-v12 .acct-tiles .acct-tile.hot { border-color: var(--hub-alert-l); background: var(--hub-alert-l); }
body.hub-v12 .acct-tiles .acct-tile.hot b { color: var(--hub-alert); }

/* --- Today: Suggested updates inbox (phase 5) ----------------------------- */
body.hub-v12 .v12-suggest { margin: 0 0 16px; }
body.hub-v12 .v12-suggest-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px;
}
body.hub-v12 .v12-suggest-head h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--hub-ink); }
body.hub-v12 .v12-suggest-count { font-size: 14px; color: var(--hub-ink-muted); font-variant-numeric: tabular-nums; }
body.hub-v12 .v12-suggest-scan,
body.hub-v12 .v12-suggest-more { min-height: 44px; }
body.hub-v12 .v12-suggest-scan { margin-left: auto; }
body.hub-v12 .v12-suggest-note { font-size: 14px; font-weight: 600; color: var(--hub-ink); }
body.hub-v12 .v12-suggest-quiet { margin: 0; font-size: 14px; color: var(--hub-ink-muted); }
body.hub-v12 .v12-suggest-list { display: grid; gap: 12px; }
body.hub-v12 .v12-suggest-more { margin-top: 12px; }
body.hub-v12 .v12-suggest-card {
  padding: 14px 16px;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
  color: var(--hub-ink);
}
body.hub-v12 .v12-suggest-card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
body.hub-v12 .v12-suggest-table { width: 100%; border-collapse: collapse; font-size: 14px; }
body.hub-v12 .v12-suggest-table th,
body.hub-v12 .v12-suggest-table td {
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--hub-line);
  text-align: left;
  vertical-align: top;
}
body.hub-v12 .v12-suggest-table thead th { font-size: 12px; font-weight: 600; color: var(--hub-ink-muted); }
body.hub-v12 .v12-suggest-table tbody th { font-weight: 400; color: var(--hub-ink-muted); }
body.hub-v12 .v12-suggest-now { color: var(--hub-ink-muted); }
body.hub-v12 .v12-suggest-new { color: var(--hub-ink); font-weight: 600; }
body.hub-v12 .v12-suggest-from { margin: 10px 0 0; font-size: 14px; color: var(--hub-ink); }
body.hub-v12 .v12-suggest-evidence { margin: 4px 0 0; font-size: 13px; color: var(--hub-ink-muted); }
body.hub-v12 .v12-suggest-error { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--hub-alert); }
body.hub-v12 .v12-suggest-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
body.hub-v12 .v12-suggest-actions button { min-height: 44px; min-width: 96px; }
body.hub-v12 .v12-suggest-card.done { padding: 12px 16px; }
body.hub-v12 .v12-suggest-result { margin: 0; font-size: 14px; color: var(--hub-ink-muted); }
body.hub-v12 .v12-suggest-result b { color: var(--hub-ink); font-weight: 600; }
body.hub-v12.v12-phone .v12-suggest-scan { margin-left: 0; }

/* Advisor in the header (desktop, new layout). The pane moves from the right
   rail into this panel; phones and Classic keep it in the rail. ------------ */
body.hub-v12:not(.v12-phone) .v12-adv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hub-line-strong);
  border-radius: var(--hub-radius);
  background: var(--hub-surface);
  color: var(--hub-action);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
body.hub-v12:not(.v12-phone) .v12-adv-btn svg { width: 18px; height: 18px; }
body.hub-v12:not(.v12-phone) .v12-adv-btn:hover { background: var(--hub-action-l); }
body.hub-v12:not(.v12-phone) .v12-adv-btn[aria-expanded="true"] {
  background: var(--hub-action-l);
  border-color: var(--hub-action-line);
}
body.hub-v12 .v12-adv-btn[hidden],
body.hub-v12 .v12-adv-panel[hidden],
body.hub-v12 #teamChatRail .hub-side-lower[hidden] { display: none !important; }
body.hub-v12 .v12-adv-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 36;
  width: min(440px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--hub-surface);
  border-left: 1px solid var(--hub-line-strong);
  color: var(--hub-ink);
}
body.hub-v12 .v12-adv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--hub-line);
}
body.hub-v12 .v12-adv-head h2 { margin: 0; font-size: 16px; color: var(--hub-ink); }
body.hub-v12 .v12-adv-close {
  width: var(--hub-tap);
  height: var(--hub-tap);
  border: 0;
  border-radius: var(--hub-radius);
  background: transparent;
  color: var(--hub-ink-muted);
  cursor: pointer;
}
body.hub-v12 .v12-adv-close svg { width: 20px; height: 20px; }
body.hub-v12 .v12-adv-close:hover { background: var(--hub-canvas); color: var(--hub-ink); }
body.hub-v12 .v12-adv-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 16px;
}
body.hub-v12 .v12-adv-body #hubAdvisorPane { display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
body.hub-v12.v12-adv-open #hubCoachBtn { display: none !important; }
/* Bills page, desktop list + detail (new layout, 1100px and wider).
   hub-v12-bills.js adds .bills-split only under the same gate as Requests,
   so Classic, phones and narrow windows never meet these rules. */
body.hub-v12 .bills-split {
  grid-template-columns: minmax(360px, 5fr) 7fr;
  gap: 16px;
}
body.hub-v12 .bills-split .bills-split-list {
  gap: 0;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
  overflow: hidden;
}
body.hub-v12 .bills-split .bills-split-list:focus-visible { outline: 2px solid var(--hub-action); outline-offset: 2px; }
body.hub-v12 .bills-split .bills-split-list .hb-card {
  min-height: 56px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--hub-line);
  border-radius: 0;
  background: var(--hub-surface);
  box-shadow: none;
  color: var(--hub-ink);
}
body.hub-v12 .bills-split .bills-split-list .hb-card:last-of-type { border-bottom: 0; }
body.hub-v12 .bills-split .bills-split-list .hb-card:hover { background: var(--hub-canvas); }
body.hub-v12 .bills-split .bills-split-list .hb-card[aria-selected="true"] {
  background: var(--hub-action-l);
  box-shadow: inset 3px 0 0 var(--hub-action);
}
body.hub-v12 .bills-split .bills-split-list .hb-card-pick {
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
body.hub-v12 .bills-split .bills-split-list .hb-more { margin: 8px 14px; min-height: 44px; }
body.hub-v12 .bills-split .bills-split-list .hb-empty { padding: 16px 14px; }
body.hub-v12 .bills-split .bills-split-detail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  min-height: 120px;
}
/* Bills review, full width (new layout, desktop 1280px and wider; owner
   approved Oct 27 2026). hub-v12-bills.js marks the Bills page .bills-wide
   only then, and :has() keeps these rules off every other page, Classic and
   phones. The page uses the whole width. Nov 4 2026 (Eyal): the Hub menu
   stays open (docked) on Bills like every other page; the folded strip +
   Menu button only apply with body.v12-bills-fold, which nothing sets. */
body.hub-v12.v12-bills-fold:not(.v12-phone):has(#mainContent .bills-wide) { --nav-rail: 72px; }
body.hub-v12:not(.v12-phone) main#mainContent:has(.hb-page.bills-wide) {
  max-width: none;
  margin: 0;
  padding: 12px 16px;
}
/* The Menu button carries [hidden]; only this rule shows it. */
body.hub-v12.v12-bills-fold:not(.v12-phone):has(#mainContent .bills-wide) #v12BillsMenuBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 56px;
  min-height: 56px;
  margin: 8px auto;
  padding: 0;
  border: 0;
  border-radius: var(--hub-radius);
  background: transparent;
  color: var(--sidebar-text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
body.hub-v12.v12-bills-fold:not(.v12-phone):has(#mainContent .bills-wide) #v12BillsMenuBtn:hover { background: var(--sidebar-bg-hover); color: var(--hub-on-navy); }
body.hub-v12.v12-bills-fold:not(.v12-phone):has(#mainContent .bills-wide) #v12BillsMenuBtn:focus-visible { outline: none; box-shadow: var(--hub-focus); }
body.hub-v12.v12-bills-fold.v12-bills-menu-open:not(.v12-phone):has(#mainContent .bills-wide) #v12BillsMenuBtn {
  flex-direction: row;
  width: calc(100% - 16px);
  min-height: 44px;
  margin: 4px 8px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  font-size: 13px;
}
body.hub-v12 .v12-bills-menu-bars { display: flex; flex-direction: column; gap: 3px; }
body.hub-v12 .v12-bills-menu-bars i { display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor; }
body.hub-v12.v12-bills-fold:not(.v12-phone):not(.v12-bills-menu-open):has(#mainContent .bills-wide) .sidebar-scroll > :not(.sidebar-brand):not(#v12BillsMenuBtn) {
  display: none !important;
}
body.hub-v12.v12-bills-fold:not(.v12-phone):not(.v12-bills-menu-open):has(#mainContent .bills-wide) .sidebar-brand-text { display: none; }
body.hub-v12.v12-bills-fold:not(.v12-phone):not(.v12-bills-menu-open):has(#mainContent .bills-wide) .sidebar-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
body.hub-v12.v12-bills-fold.v12-bills-menu-open:not(.v12-phone):has(#mainContent .bills-wide) .sidebar.nav-rail {
  width: 248px;
  z-index: 60;
  border-right: 1px solid var(--hub-navy-2);
}

/* Header panels: To-do and Team Chat join the Advisor; no right rail on
   desktop (new layout). --------------------------------------------------- */
body.hub-v12:not(.v12-phone) .v12-adv-btn { position: relative; }
body.hub-v12 .v12-hb-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--hub-alert);
  color: var(--hub-surface);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
body.hub-v12 .v12-hb-badge[hidden] { display: none; }
body.hub-v12.v12-no-rail #teamChatRail { display: none !important; }
body.hub-v12 .v12-adv-body #hubTodoPane,
body.hub-v12 .v12-adv-body #teamChatPanel { display: block; min-height: 100%; }
body.hub-v12 .v12-adv-body #hubTodoPane .hub-todo-bar h2 { display: none; }
body.hub-v12 .v12-adv-body #hubTodoPane .hub-todo-bar {
  background: transparent;
  padding: 0 0 8px;
  justify-content: flex-end;
}
body.hub-v12 .v12-adv-body #hubTodoPane .hub-todo-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body.hub-v12 .v12-adv-body #hubTodoPane .hub-todo-add > * { flex: 1 1 140px; min-width: 0; }

/* Oct 26 2026: tall invoice preview, Expand, notes from vendor memory and
   the already-in-Buildium check (new layout dress; tokens only). */
body.hub-v12 .bills-ui .bills-panel .hb-pdf-frame { border-style: solid; background: var(--hub-surface); }
body.hub-v12 .bills-ui .bills-panel iframe.hb-pdf-frame { height: max(70vh, 520px); }
body.hub-v12.v12-phone .bills-ui .bills-panel iframe.hb-pdf-frame { height: 62vh; min-height: 360px; }
body.hub-v12 .hb-pdf-expand {
  min-height: var(--hub-tap);
  border: 1px solid var(--hub-action-line);
  background: var(--hub-surface);
  color: var(--hub-action);
  border-radius: var(--hub-radius);
}
body.hub-v12 .hb-pdf-expand:hover { background: var(--hub-action-l); }
body.hub-v12 .hb-pdf-expand:focus-visible { box-shadow: var(--hub-focus); outline: none; }
body.hub-v12 .hb-pdf-newtab { color: var(--hub-action); }
body.hub-v12 .hb-memory-note {
  background: var(--hub-action-l);
  border: 1px solid var(--hub-action-line);
  color: var(--hub-ink);
  border-radius: var(--hub-radius);
}
body.hub-v12 .hb-card-memory { color: var(--hub-action); }
body.hub-v12 .hb-pill-memory { background: var(--hub-action-l); color: var(--hub-action-d); }
body.hub-v12 .hb-inbuildium {
  background: var(--hub-done-l);
  border: 1px solid var(--hub-line);
  color: var(--hub-ink);
  border-radius: var(--hub-radius);
}
body.hub-v12 .hb-inbuildium a { color: var(--hub-action); }
body.hub-v12 .hb-toast { background: var(--hub-navy); color: var(--hub-on-navy); border-radius: var(--hub-radius-card); }
body.hub-v12 .hb-toast-act { background: var(--hub-surface); color: var(--hub-navy); min-height: var(--hub-tap); }
body.hub-v12 .hb-toast-x { color: var(--hub-on-navy); min-width: var(--hub-tap); min-height: var(--hub-tap); }
body.hub-v12 .hb-viewer-bar { background: var(--hub-navy); color: var(--hub-on-navy); }
body.hub-v12 .hb-viewer-tools button { min-width: var(--hub-tap); min-height: var(--hub-tap); border-radius: var(--hub-radius); }
body.hub-v12 .hb-viewer-tools .hb-viewer-close { background: var(--hub-surface); color: var(--hub-navy); }
body.hub-v12 .hb-viewer-newtab { color: var(--hub-on-navy-muted); }

/* Bills page, approved mockup (new layout, desktop 1100px and wider).
   hub-v12-bills.js adds .bills-ui under the same gate as the split view.
   Navy is structure, blue is anything you can act on, red only a problem. */
body.hub-v12 .bills-ui { color: var(--hub-ink); }
body.hub-v12 .bills-ui .bills-head { align-items: center; margin-bottom: 12px; }
body.hub-v12 .bills-ui .bills-head h2 { font-size: 24px; font-weight: 600; margin: 0; color: var(--hub-ink); }
body.hub-v12 .bills-ui .bills-head .hb-flow { display: none; }
body.hub-v12 .bills-ui .bills-head .muted { font-size: 13px; color: var(--hub-ink-muted); }
body.hub-v12 .bills-ui .bills-quick { gap: 8px; }
body.hub-v12 .bills-ui .bills-quick .hb-manage-btn,
body.hub-v12 .bills-ui .bills-quick .hb-sync-btn,
body.hub-v12 .bills-ui .bills-quick .hb-upload,
body.hub-v12 .bills-ui .bills-tools > summary {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius);
  background: var(--hub-surface);
  color: var(--hub-action);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
body.hub-v12 .bills-ui .bills-quick .hb-manage-btn.on,
body.hub-v12 .bills-ui .bills-quick .bills-cal-btn[aria-expanded="true"] {
  background: var(--hub-action-l);
  border-color: var(--hub-action-line);
}
body.hub-v12 .bills-ui .bills-tools { position: relative; }
body.hub-v12 .bills-ui .bills-tools > summary { list-style: none; }
body.hub-v12 .bills-ui .bills-tools > summary::-webkit-details-marker { display: none; }
body.hub-v12 .bills-ui .bills-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  margin-top: 6px;
  background: var(--hub-surface);
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius);
}
body.hub-v12 .bills-ui .bills-tools .bills-menu {
  position: absolute;
  right: 0;
  z-index: 5;
  min-width: 240px;
}
body.hub-v12 .bills-ui .bills-menu button {
  min-height: 40px;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: var(--hub-surface);
  color: var(--hub-ink);
  font-size: 14px;
  font-weight: 500;
  padding: 0 12px;
}
body.hub-v12 .bills-ui .bills-menu button:hover { background: var(--hub-canvas); }
body.hub-v12 .bills-ui #hubV12BillsLook { margin-bottom: 12px; }

/* Filters: bill type as a segmented control, status as chips. */
body.hub-v12 .bills-ui .bills-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
}
body.hub-v12 .bills-ui .bills-filterbar .hb-modes,
body.hub-v12 .bills-ui .bills-filterbar .hb-filters { margin: 0; }
body.hub-v12 .bills-ui .bills-seg {
  gap: 4px;
  padding: 4px;
  background: var(--hub-navy-l);
  border-radius: var(--hub-radius);
}
body.hub-v12 .bills-ui .bills-seg button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--hub-ink-muted);
  font-size: 14px;
  font-weight: 600;
}
body.hub-v12 .bills-ui .bills-seg button.on {
  background: var(--hub-surface);
  color: var(--hub-navy);
}
body.hub-v12 .bills-ui .bills-chips { flex: 1 1 auto; gap: 8px; }
body.hub-v12 .bills-ui .bills-chips button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--hub-line);
  border-radius: 999px;
  background: var(--hub-surface);
  color: var(--hub-ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
body.hub-v12 .bills-ui .bills-chips button.on {
  background: var(--hub-navy);
  border-color: var(--hub-navy);
  color: var(--hub-on-navy);
}
body.hub-v12 .bills-ui .bills-chips .bills-count { color: var(--hub-on-navy-muted); font-variant-numeric: tabular-nums; }
body.hub-v12 .bills-ui .bills-chips .hb-search { min-height: 36px; min-width: 200px; border-radius: var(--hub-radius); }
body.hub-v12 .bills-ui .bills-seg button:focus-visible,
body.hub-v12 .bills-ui .bills-chips button:focus-visible,
body.hub-v12 .bills-ui .bills-quick button:focus-visible,
body.hub-v12 .bills-ui summary:focus-visible,
body.hub-v12 .bills-ui .bills-actions button:focus-visible {
  outline: none;
  box-shadow: var(--hub-focus);
}

/* List as a compact table: one 48px row per bill. */
body.hub-v12 .bills-ui .bills-split {
  grid-template-columns: minmax(0, 3fr) minmax(340px, 2fr);
  align-items: start;
}
body.hub-v12 .bills-ui .bills-table {
  min-width: 0;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
  overflow: hidden;
  container-type: inline-size;
}
body.hub-v12 .bills-ui .bills-table .bills-split-list { border: 0; border-radius: 0; }
body.hub-v12 .bills-ui .bills-thead,
body.hub-v12 .bills-ui .bills-split .bills-split-list .hb-card.bills-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1fr) 64px 96px minmax(0, 1.4fr);
  align-items: center;
  column-gap: 10px;
  padding: 0 12px 0 0;
}
body.hub-v12 .bills-ui .bills-thead {
  min-height: 40px;
  background: var(--hub-canvas);
  border-bottom: 1px solid var(--hub-line);
  color: var(--hub-ink-muted);
  font-size: 12px;
  font-weight: 600;
}
body.hub-v12 .bills-ui .bills-split .bills-split-list .hb-card.bills-row {
  min-height: 48px;
  font-size: 14px;
}
body.hub-v12 .bills-ui .bills-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.hub-v12 .bills-ui .bills-c-pick { display: flex; justify-content: center; overflow: visible; }
body.hub-v12 .bills-ui .bills-c-vendor { font-weight: 600; }
body.hub-v12 .bills-ui .bills-c-prop,
body.hub-v12 .bills-ui .bills-c-inv,
body.hub-v12 .bills-ui .bills-c-due { color: var(--hub-ink-muted); }
body.hub-v12 .bills-ui .bills-num { text-align: right; font-variant-numeric: tabular-nums; }
body.hub-v12 .bills-ui .bills-c-amt { color: var(--hub-ink); font-weight: 600; }
body.hub-v12 .bills-ui .bills-c-status { display: flex; gap: 4px; align-items: center; }
body.hub-v12 .bills-ui .bills-c-status .hb-pill { font-size: 11px; white-space: nowrap; }
body.hub-v12 .bills-ui .bills-alert-text { color: var(--hub-alert); font-weight: 600; }
body.hub-v12 .bills-ui .bills-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
body.hub-v12 .bills-ui .bills-pill-alert { background: var(--hub-alert-l); color: var(--hub-alert); }
body.hub-v12 .bills-ui .bills-pill-wait { background: var(--hub-wait-l); color: var(--hub-wait); }
body.hub-v12 .bills-ui .bills-pill-done { background: var(--hub-done-l); color: var(--hub-done); }
body.hub-v12 .bills-ui .bills-pill-off { background: var(--hub-off-l); color: var(--hub-off); }
@container (max-width: 620px) {
  body.hub-v12 .bills-ui .bills-thead,
  body.hub-v12 .bills-ui .bills-split .bills-split-list .hb-card.bills-row {
    grid-template-columns: 44px minmax(0, 1.5fr) minmax(0, 1.2fr) 56px 88px minmax(0, 1.2fr);
  }
  body.hub-v12 .bills-ui .bills-thead > :nth-child(4),
  body.hub-v12 .bills-ui .bills-c-inv { display: none; }
}
@container (max-width: 500px) {
  body.hub-v12 .bills-ui .bills-thead,
  body.hub-v12 .bills-ui .bills-split .bills-split-list .hb-card.bills-row {
    grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, 1fr) 84px minmax(0, max-content);
    column-gap: 8px;
  }
  body.hub-v12 .bills-ui .bills-thead > :nth-child(5),
  body.hub-v12 .bills-ui .bills-c-due,
  body.hub-v12 .bills-ui .bills-c-status > :not(:first-child) { display: none; }
}

/* Detail panel. */
body.hub-v12 .bills-ui .bills-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
}
body.hub-v12 .bills-ui .bills-panel > * { margin-top: 0; margin-bottom: 0; }
body.hub-v12 .bills-ui .bills-dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
body.hub-v12 .bills-ui .bills-dname { font-size: 18px; font-weight: 600; }
body.hub-v12 .bills-ui .bills-dsrc { font-size: 14px; color: var(--hub-ink-muted); }
body.hub-v12 .bills-ui .bills-damt { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.hub-v12 .bills-ui .bills-panel .hb-pdf-name { display: none; }
body.hub-v12 .bills-ui .bills-panel .hb-pdf-frame,
body.hub-v12 .bills-ui .bills-panel .hb-pdf-missing {
  border-radius: var(--hub-radius);
  background: var(--hub-off-l);
  border: 1px dashed var(--hub-line-strong);
  color: var(--hub-ink-muted);
}
body.hub-v12 .bills-ui .bills-panel .hb-pdf-missing { padding: 24px; }
body.hub-v12 .bills-ui .bills-c-vendor .bills-memo { display: block; font-size: 12px; font-weight: 400; color: var(--hub-action); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

body.hub-v12 .bills-ui .bills-panel .hb-upload-draft { margin-top: 8px; color: var(--hub-action); }
body.hub-v12 .bills-ui .bills-keygrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
body.hub-v12 .bills-ui .bills-keygrid label,
body.hub-v12 .bills-ui .bills-more-details .hb-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hub-ink-muted);
  grid-column: auto;
}
body.hub-v12 .bills-ui .bills-more-details .hb-fields .hb-span { grid-column: 1 / -1; }
body.hub-v12 .bills-ui .bills-keygrid label { margin: 0; }
body.hub-v12 .bills-ui .bills-keygrid small { font-weight: 400; font-size: 12px; }
body.hub-v12 .bills-ui .bills-keygrid .bills-hint-off { display: none; }
body.hub-v12 .bills-ui .bills-keygrid input,
body.hub-v12 .bills-ui .bills-keygrid select,
body.hub-v12 .bills-ui .bills-more-details input:not([type="range"]):not([type="checkbox"]),
body.hub-v12 .bills-ui .bills-more-details select {
  min-height: 40px;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--hub-ink);
  background: var(--hub-surface);
}
body.hub-v12 .bills-ui .bills-more-details {
  border-top: 1px solid var(--hub-line);
  padding-top: 12px;
}
body.hub-v12 .bills-ui .bills-more-details > summary,
body.hub-v12 .bills-ui .bills-more-actions > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--hub-action);
  font-size: 14px;
  font-weight: 600;
}
body.hub-v12 .bills-ui .bills-more-details[open] > summary { margin-bottom: 12px; }
body.hub-v12 .bills-ui .bills-more-details .hb-fields { margin: 12px 0 0; }
body.hub-v12 .bills-ui .bills-panel .hb-notice,
body.hub-v12 .bills-ui .bills-panel > .muted { font-size: 13px; color: var(--hub-ink-muted); }
body.hub-v12 .bills-ui .bills-panel .hb-err { color: var(--hub-alert); background: var(--hub-alert-l); }

/* Pay-rule message as a wait banner. */
body.hub-v12 .bills-ui .bills-panel .bills-wait {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--hub-radius);
  background: var(--hub-wait-l);
  color: var(--hub-ink);
  font-size: 13px;
  line-height: 1.4;
}
body.hub-v12 .bills-ui .bills-wait .bills-pill { background: var(--hub-surface); color: var(--hub-wait); flex-shrink: 0; }
body.hub-v12 .bills-ui .bills-panel .bills-rule {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--hub-ink-muted);
}

/* Actions: one primary, Hold, the rest under More actions. */
body.hub-v12 .bills-ui .bills-panel .bills-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: flex-start;
  margin: 0;
}
body.hub-v12 .bills-ui .bills-actions > .bills-primary {
  flex: 1 1 160px;
  min-height: 44px;
  border: 0;
  border-radius: var(--hub-radius);
  background: var(--hub-action);
  color: var(--hub-on-navy);
  font-size: 15px;
  font-weight: 600;
}
body.hub-v12 .bills-ui .bills-actions > .bills-primary:hover { background: var(--hub-action-d); }
body.hub-v12 .bills-ui .bills-actions > .bills-secondary,
body.hub-v12 .bills-ui .bills-more-actions > summary {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius);
  background: var(--hub-surface);
  color: var(--hub-navy);
  font-size: 14px;
  font-weight: 600;
}
body.hub-v12 .bills-ui .bills-more-actions { position: relative; }
body.hub-v12 .bills-ui .bills-more-actions > summary { list-style: none; color: var(--hub-navy); }
body.hub-v12 .bills-ui .bills-more-actions > summary::-webkit-details-marker { display: none; }
body.hub-v12 .bills-ui .bills-more-actions[open] { flex: 1 1 100%; }
body.hub-v12 .bills-ui .bills-more-actions .bills-menu button.primary,
body.hub-v12 .bills-ui .bills-more-actions .bills-menu button.hb-danger {
  background: var(--hub-surface);
  color: var(--hub-ink);
  border: 0;
}

/* Full-width review (desktop 1280px+, .bills-wide): queue | invoice | form.
   Only the three panes scroll; the form's buttons stay at the bottom. */
body.hub-v12 .bills-ui.bills-wide .bills-head { margin-bottom: 6px; }
body.hub-v12 .bills-ui.bills-wide .bills-head h2 { font-size: 20px; }
body.hub-v12 .bills-ui.bills-wide .bills-head .muted { display: none; }
body.hub-v12 .bills-ui.bills-wide .hb-tabs { margin: 0 0 8px; }
body.hub-v12 .bills-ui.bills-wide .bills-head > .hb-tabs { flex: 1 1 auto; align-self: flex-end; margin: 0; border-bottom: 0; }
body.hub-v12 .bills-ui.bills-wide .bills-filterbar { margin: 0 0 10px; }
body.hub-v12 .bills-ui .bills-split.bills-wide-split {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  height: var(--bills-pane-h, calc(100vh - 240px));
  min-height: 460px;
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
  overflow: hidden;
}

/* Queue */
body.hub-v12 .bills-ui .bills-listpane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--hub-line);
  background: var(--hub-surface);
}
body.hub-v12 .bills-ui .bills-listtools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hub-line);
}
body.hub-v12 .bills-ui .bills-listtools .hb-search {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--hub-line-strong);
  border-radius: var(--hub-radius);
  padding: 0 10px;
  font-size: 14px;
}
body.hub-v12 .bills-ui .bills-listtools .hb-batch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.hub-v12 .bills-ui .bills-listtools .hb-batch-all { font-size: 13px; color: var(--hub-ink-muted); margin-right: 2px; min-height: 32px; }
body.hub-v12 .bills-ui .bills-listtools .hb-batch button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--hub-line-strong);
  border-radius: 6px;
  background: var(--hub-surface);
  color: var(--hub-ink);
  font-size: 12px;
  font-weight: 600;
}
body.hub-v12 .bills-ui .bills-listtools .hb-batch button.primary { border-color: var(--hub-action); background: var(--hub-action); color: var(--hub-on-navy); }
body.hub-v12 .bills-ui .bills-listtools .hb-batch button.hb-danger { border-color: var(--hub-alert-l); color: var(--hub-alert); }
body.hub-v12 .bills-ui .bills-listtools .hb-batch button:disabled { opacity: .55; }
body.hub-v12 .bills-ui .bills-listtools .hb-batch .muted { font-size: 12px; color: var(--hub-ink-muted); }
body.hub-v12 .bills-ui .bills-wide-split .bills-split-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
}
body.hub-v12 .bills-ui .bills-wide-split .bills-split-list .hb-card.bills-crow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  flex: none;
  min-height: 56px;
  padding: 6px 12px 6px 0;
  font-size: 13px;
  cursor: pointer;
}
body.hub-v12 .bills-ui .bills-crow-pick { display: flex; justify-content: center; }
body.hub-v12 .bills-ui .bills-crow-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.hub-v12 .bills-ui .bills-crow-vendor,
body.hub-v12 .bills-ui .bills-crow-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.hub-v12 .bills-ui .bills-crow-vendor { font-weight: 600; color: var(--hub-ink); }
body.hub-v12 .bills-ui .bills-crow-meta { font-size: 12px; color: var(--hub-ink-muted); }
body.hub-v12 .bills-ui .bills-crow-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
body.hub-v12 .bills-ui .bills-crow-pills .bills-pill,
body.hub-v12 .bills-ui .bills-crow-pills .hb-pill { height: 20px; padding: 0 8px; font-size: 11px; }
body.hub-v12 .bills-ui .bills-crow-pills .bills-memo { font-size: 11px; color: var(--hub-action); }
body.hub-v12 .bills-ui .bills-crow-amt { font-weight: 700; color: var(--hub-ink); white-space: nowrap; }
body.hub-v12 .bills-ui .bills-listfoot {
  padding: 8px 12px;
  border-top: 1px solid var(--hub-line);
  font-size: 12px;
  color: var(--hub-ink-muted);
}

/* Invoice + form share .hb-detail (hbReadFields reads from it). */
body.hub-v12 .bills-ui .bills-wide-split .hb-detail.bills-wide-detail {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  min-width: 0;
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow: hidden;
}
body.hub-v12 .bills-ui .bills-wide-split .hb-detail.bills-wide-empty { display: block; padding: 24px; overflow-y: auto; }
body.hub-v12 .bills-ui .bills-viewer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 10px 12px 12px;
  background: var(--hub-line);
}
body.hub-v12 .bills-ui .bills-vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.hub-v12 .bills-ui .bills-vwho { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
body.hub-v12 .bills-ui .bills-vname { font-size: 14px; color: var(--hub-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.hub-v12 .bills-ui .bills-vsrc { font-size: 12px; color: var(--hub-ink-muted); }
body.hub-v12 .bills-ui .bills-vtools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
body.hub-v12 .bills-ui .bills-vgroup {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--hub-line-strong);
  border-radius: var(--hub-radius);
  background: var(--hub-surface);
  overflow: hidden;
}
body.hub-v12 .bills-ui .bills-vgroup .bills-vbtn { border: 0; border-radius: 0; min-width: 36px; font-size: 16px; }
body.hub-v12 .bills-ui .bills-vzoom { min-width: 44px; text-align: center; font-size: 12px; color: var(--hub-ink-muted); font-variant-numeric: tabular-nums; }
body.hub-v12 .bills-ui .bills-vtools .bills-vbtn,
body.hub-v12 .bills-ui .bills-vtools .bills-vlink,
body.hub-v12 .bills-ui .bills-vtools .hb-upload-draft {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--hub-line-strong);
  border-radius: var(--hub-radius);
  background: var(--hub-surface);
  color: var(--hub-ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
body.hub-v12 .bills-ui .bills-vtools .bills-vlink,
body.hub-v12 .bills-ui .bills-vtools a.bills-vbtn,
body.hub-v12 .bills-ui .bills-vtools .hb-upload-draft { color: var(--hub-action); }
body.hub-v12 .bills-ui .bills-vtools .bills-vbtn[aria-pressed="true"] { background: var(--hub-action-l); border-color: var(--hub-action-line); }
body.hub-v12 .bills-ui .bills-vtools .bills-vbtn:hover,
body.hub-v12 .bills-ui .bills-vtools .bills-vlink:hover { background: var(--hub-action-l); }
body.hub-v12 .bills-ui .bills-vtools button:focus-visible,
body.hub-v12 .bills-ui .bills-vtools a:focus-visible,
body.hub-v12 .bills-ui .bills-vtools .hb-upload-draft:focus-within,
body.hub-v12 .bills-ui .bills-listtools button:focus-visible,
body.hub-v12 .bills-ui .bills-listtools input:focus-visible,
body.hub-v12 .bills-ui .bills-footer summary:focus-visible { outline: none; box-shadow: var(--hub-focus); }
body.hub-v12 .bills-ui .bills-vbody {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: var(--hub-radius);
  background: var(--hub-surface);
}
body.hub-v12 .bills-ui .bills-vbody iframe.hb-pdf-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
}
body.hub-v12 .bills-ui .bills-vbody img.hb-pdf-frame {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0 auto;
  border: 0;
  object-fit: contain;
}
body.hub-v12 .bills-ui .bills-vbody .hb-pdf-missing {
  margin: 0;
  padding: 24px;
  border: 0;
  background: var(--hub-surface);
  color: var(--hub-ink-muted);
}

/* Form */
body.hub-v12 .bills-ui .bills-wide-detail .bills-panel.bills-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--hub-line);
  border-radius: 0;
  background: var(--hub-surface);
  overflow: hidden;
}
body.hub-v12 .bills-ui .bills-form > .bills-dhead {
  flex: none;
  align-items: baseline;
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--hub-line);
}
body.hub-v12 .bills-ui .bills-form .bills-dname { font-size: 16px; }
body.hub-v12 .bills-ui .bills-form .bills-dsrc { font-size: 13px; }
body.hub-v12 .bills-ui .bills-form .bills-damt { font-size: 22px; }
body.hub-v12 .bills-ui .bills-form > .hb-pdf { display: none; }
body.hub-v12 .bills-ui .bills-formbody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px 14px;
}
body.hub-v12 .bills-ui .bills-formbody > * { margin-top: 0; margin-bottom: 0; }
body.hub-v12 .bills-ui .bills-formgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: start;
}
body.hub-v12 .bills-ui .bills-formgrid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--hub-ink-muted);
}
body.hub-v12 .bills-ui .bills-formgrid .bills-full { grid-column: 1 / -1; }
body.hub-v12 .bills-ui .bills-formgrid .bills-half { grid-column: auto; }
body.hub-v12 .bills-ui .bills-formgrid small { margin: 0; font-size: 12px; font-weight: 400; line-height: 1.35; color: var(--hub-ink-muted); }
body.hub-v12 .bills-ui .bills-formgrid .bills-hint-off { display: none; }
body.hub-v12 .bills-ui .bills-formgrid input:not([type="hidden"]):not([type="checkbox"]),
body.hub-v12 .bills-ui .bills-formgrid select,
body.hub-v12 .bills-ui .bills-formgrid textarea,
body.hub-v12 .bills-ui .bills-form .bills-more-details input:not([type="range"]):not([type="checkbox"]):not([type="hidden"]),
body.hub-v12 .bills-ui .bills-form .bills-more-details select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--hub-line-strong);
  border-radius: var(--hub-radius);
  padding: 0 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--hub-ink);
  background: var(--hub-surface);
}
body.hub-v12 .bills-ui .bills-formgrid textarea { min-height: 52px; padding: 6px 10px; resize: vertical; }
body.hub-v12 .bills-ui .bills-formgrid [data-hbvendorstatus] { color: var(--hub-done); }
body.hub-v12 .bills-ui .bills-formgrid [data-hbvendorstatus] .hb-err { padding: 0; background: transparent; color: var(--hub-alert); }
body.hub-v12 .bills-ui .bills-formgrid .bills-match[data-ok="yes"] { color: var(--hub-done); }
body.hub-v12 .bills-ui .bills-formgrid .bills-match[data-ok="no"] { color: var(--hub-alert); }
body.hub-v12 .bills-ui .bills-formgrid .hb-autorec { display: flex; flex-direction: column; gap: 4px; margin-top: -4px; }
body.hub-v12 .bills-ui .bills-formgrid .hb-autorec .hb-autorec-switch { flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; color: var(--hub-ink); cursor: pointer; }
body.hub-v12 .bills-ui .bills-formgrid .hb-autorec .hb-autorec-switch input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; }
body.hub-v12 .bills-ui .bills-formgrid .hb-autorec .hb-autorec-switch span { flex: 0 1 auto; }
body.hub-v12 .bills-ui .bills-form .bills-more-details { padding-top: 6px; }
body.hub-v12 .bills-ui .bills-form .bills-more-details > summary { min-height: 36px; }
body.hub-v12 .bills-ui .bills-form .bills-more-details .hb-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 8px 0 0;
}
body.hub-v12 .bills-ui .bills-form .bills-more-details .hb-email-meta,
body.hub-v12 .bills-ui .bills-form .bills-more-details .hb-drive {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--hub-ink-muted);
}
body.hub-v12 .bills-ui .bills-form .bills-more-details .hb-draft-mode { margin: 8px 0 0; }

/* Buttons pinned at the bottom of the form. */
body.hub-v12 .bills-ui .bills-form > .bills-actions.bills-footer {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 18px 12px;
  border-top: 1px solid var(--hub-line);
  background: var(--hub-surface);
}
body.hub-v12 .bills-ui .bills-footer > .bills-secondary,
body.hub-v12 .bills-ui .bills-footer .bills-more-actions > summary { min-height: 40px; }
body.hub-v12 .bills-ui .bills-footer .bills-more-actions[open] { flex: none; }
body.hub-v12 .bills-ui .bills-footer .bills-more-actions .bills-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 6;
  min-width: 260px;
  margin: 0;
}
body.hub-v12 .bills-ui .bills-footer > .bills-recpay {
  margin-left: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hub-action);
  border-radius: var(--hub-radius);
  background: var(--hub-surface);
  color: var(--hub-action);
  font-size: 14px;
  font-weight: 600;
}
body.hub-v12 .bills-ui .bills-footer > .bills-recpay:hover { background: var(--hub-action-l); }
body.hub-v12 .bills-ui .bills-footer > .bills-primary { flex: 0 1 auto; min-height: 40px; margin-left: auto; padding: 0 16px; }
/* With Record & pay there too, Approve takes its own full-width row. */
body.hub-v12 .bills-ui .bills-footer > .bills-recpay + .bills-primary { flex: 1 1 100%; margin-left: 0; }
