@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --navy: #000000;
  --electric: #2B7FFF;
  --bg: #000000;
  --bg-2: #0A0A0A;
  --panel: #0A0A0A;
  --panel-2: #0A0A0A;
  --ink: #E8E8E8;
  --muted: #8A8A8A;
  --faint: #8A8A8A;
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.20);
  --accent: #2B7FFF;
  --accent-2: #2B7FFF;
  --glow: transparent;
  --steel: #8A8A8A;
  --ok: #1a7a4a;
  --warn: #a67c00;
  --bad: #e24a40;
  --block: #e24a40;
  --money: #1a7a5c;
  --ice: #2B7FFF;
  --tap: 46px;
  --radius: 16px;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  /* Locked FieldBot chrome — Grok black, electric only where it matters */
  --sidebar-bg: #000000;
  --sidebar-border: rgba(255, 255, 255, 0.12);
  --sidebar-text: #E8E8E8;
  --sidebar-muted: #8A8A8A;
  --sidebar-active-bg: transparent;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  --sidebar-accent: #2B7FFF;
  --fb-bg: #000000;
  --fb-bg-2: #0A0A0A;
  --fb-ink: #E8E8E8;
  --fb-ink-2: #FFFFFF;
  --fb-muted: #8A8A8A;
  --fb-faint: #8A8A8A;
  --fb-line: #2A2A2A;
  --fb-line-2: rgba(255, 255, 255, 0.20);
  --fb-primary: #2B7FFF;
  --fb-navy: #000000;
  --fb-chrome-ink: #E8E8E8;
}

* { box-sizing: border-box; }
html, body, .shell { height: 100%; }
html { background: var(--bg); }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
body {
  font-family: Inter, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.011em;
  min-height: 100vh;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .55rem; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 1.35rem; font-weight: 600; }
h2 {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

/* —— Grok shell —— */
.shell {
  display: flex;
  min-height: 100vh;
  height: 100%;
  background: var(--bg);
}
.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: var(--sidebar-bg, #F7F7F7);
  border-right: 1px solid var(--sidebar-border, rgba(5, 5, 5, 0.06));
  color: var(--sidebar-text, var(--ink));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}
body.desk-shell .sidebar-toggle,
body.desk-shell .right-dock-toggle,
body.desk-shell .live-split-toggle { display: none !important; }
/* no desktop collapse */
body.sidebar-collapsed .sidebar {
  width: 64px;
  flex-basis: 64px;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem .9rem .45rem;
}
.sidebar-toggle {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--sidebar-muted, var(--muted));
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  flex: 0 0 auto;
}
.sidebar-toggle:hover { background: var(--sidebar-hover-bg, rgba(5, 5, 5, 0.05)); color: var(--sidebar-text, var(--ink)); }
.sidebar .brand {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--sidebar-text, #FFFFFF);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
  min-width: 0;
}
.sidebar .brand span,
.sidebar .fieldbot-word { color: var(--sidebar-text, #FFFFFF); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: 1.05rem;
  color: #0B1F3A;
}
.brand span { color: var(--ice); }
.brand-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0B1F3A;
}
.brand-lg span { color: var(--ice); }
.brand img,
.fieldbot-mark {
  display: block;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  flex: 0 0 auto;
}
.fieldbot-mark-sm {
  width: 56px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
}
.fieldbot-mark-md {
  width: 72px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
}
.fieldbot-mark-lg {
  width: 240px;
  max-width: min(240px, 70vw);
  height: auto;
  border-radius: 0;
}
.fieldbot-word {
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.sidebar .fieldbot-mark,
.sidebar .brand img {
  width: 96px;
  height: auto;
  max-width: 160px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: .35rem .65rem .5rem;
  gap: .12rem;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .7rem;
  min-height: 40px;
  border-radius: 10px;
  color: var(--sidebar-text, var(--ink));
  font-size: .92rem;
  font-weight: 500;
}
.sidebar-nav a::before {
  display: inline-flex;
  width: 1.15rem;
  justify-content: center;
  flex: 0 0 auto;
  font-size: .95rem;
  opacity: .65;
}
#navSearch::before { content: ""; }
.sidebar-nav .nav-urgent::before,
[data-nav-group="urgent"]::before { content: ""; }
[data-nav-group="webchat"]::before { content: ""; }
[data-nav="/conversations"]::before,
[data-nav-group="conversations"]::before { content: ""; }
[data-nav="/schedule"]::before { content: ""; }
[data-nav="/map"]::before { content: ""; }
[data-nav="/contacts"]::before { content: ""; }
[data-nav-group="live"]::before { content: ""; }
[data-nav-group="leads"]::before { content: ""; }
[data-nav-group="estimates"]::before { content: ""; }
[data-nav-group="service"]::before { content: ""; }
[data-nav-group="open"]::before { content: ""; }
[data-nav-group="completed"]::before { content: ""; }
[data-nav-group="schedule"]::before { content: ""; }
[data-nav-group="clients"]::before { content: ""; }
[data-nav-group="crew"]::before { content: ""; }
[data-nav-group="money"]::before { content: ""; }
[data-nav-group="settings"]::before { content: ""; }
.sidebar-nav a:hover { background: var(--sidebar-hover-bg, rgba(5, 5, 5, 0.045)); color: var(--sidebar-text, var(--ink)); }
.sidebar-nav a.on {
  background: var(--sidebar-active-bg, rgba(5, 5, 5, 0.07));
  color: var(--sidebar-text, var(--ink));
  box-shadow: inset 3px 0 0 var(--sidebar-accent, var(--ice));
}
.sidebar-nav .nav-urgent,
.sidebar-nav .nav-urgent:hover,
.sidebar-nav a.nav-urgent.on {
  color: #e24a40;
}
.nav-urgent span,
.sidebar-nav [data-nav-group="conversations"] span,
.sidebar-nav [data-nav="/hq/conversations"] span {
  display: inline-block;
  min-width: 1.1em;
  margin-left: .15rem;
  font-weight: 700;
}

.sidebar-history {
  flex: 1;
  overflow: auto;
  padding: .25rem .65rem 1rem;
  min-height: 0;
}
.sidebar-label {
  font-size: .72rem;
  color: var(--sidebar-muted, var(--muted));
  font-weight: 600;
  padding: .45rem .6rem .35rem;
}
.thread-row {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  padding: .48rem .65rem;
  border-radius: 10px;
  color: var(--sidebar-text, var(--ink));
  min-width: 0;
}
.thread-row:hover, .thread-row.on { background: var(--sidebar-hover-bg, rgba(43, 127, 255, 0.12)); color: var(--sidebar-text, var(--ink)); }
.thread-title {
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-sub {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-foot {
  padding: .75rem .85rem 1rem;
  border-top: 1px solid var(--sidebar-border, var(--line));
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.sidebar-foot a { color: var(--sidebar-muted, var(--muted)); font-size: .85rem; }
.sidebar-foot a:hover { color: var(--sidebar-text, var(--ink)); }
.sidebar-foot .shop-id {
  border-left: 0;
  padding-left: 0;
  gap: .55rem;
}
.shop-id {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  color: inherit;
}
.shop-id[hidden] { display: none; }
.shop-logo {
  height: 28px;
  width: auto;
  max-width: 28px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  background: transparent;
  border-radius: 6px;
}
.shop-logo[hidden] { display: none; }
.shop-id-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  border-left: 0;
  padding-left: 0;
  margin-top: .7rem;
}
.shop-logo-lg { height: var(--chat-sliver, 108px); max-width: 72px; }
.shop-logo-lg[src=""] { display: none; }
.shop-mark {
  color: var(--sidebar-muted, var(--muted));
  letter-spacing: .04em;
  font-size: .78rem;
  font-weight: 600;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-id:hover .shop-mark { color: var(--sidebar-text, var(--ink)); }
.shop-mark:empty { display: none; }
.shop-mark-lg {
  display: block;
  margin: .55rem auto 0;
  max-width: 100%;
  text-align: center;
  font-size: .9rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
.shop-mark-lg:empty { display: none; }

body.sidebar-collapsed .sidebar-top { justify-content: center; padding: .85rem .4rem; }
body.sidebar-collapsed .brand,
body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .sidebar-history,
body.sidebar-collapsed .shop-mark,
body.sidebar-collapsed .sidebar-foot a[href="/logout"],
body.sidebar-collapsed #urgentCount { display: none; }
body.sidebar-collapsed .sidebar-nav a {
  justify-content: center;
  padding: .55rem;
  font-size: 0;
  gap: 0;
}
body.sidebar-collapsed .sidebar-nav a::before { font-size: 1.05rem; opacity: .8; }
body.sidebar-collapsed .sidebar-foot { align-items: center; padding: .75rem .4rem; }

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}
.app {
  flex: 1;
  overflow: auto;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.6rem 1.5rem 1.25rem;
}
.composer {
  display: flex;
  align-items: center;
  width: calc(100% - 2.5rem);
  max-width: 44rem;
  height: 60px;
  margin: 0 auto 1.25rem;
  padding: 0 .4rem 0 1.35rem;
  background: #FFFFFF;
  border: 1px solid var(--line-2);
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(5, 5, 5, 0.04);
  flex: 0 0 auto;
  position: sticky;
  bottom: 1.25rem;
}
.composer input,
.composer input:focus {
  border: 0;
  background: transparent;
  min-height: 0;
  height: 100%;
  padding: 0;
  box-shadow: none;
  outline: none;
  width: 100%;
  color: var(--ink);
}
.composer input::placeholder { color: var(--faint); }
.composer-go {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #111111;
  color: #fff;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 1.05rem;
  line-height: 1;
}
.composer-go:hover { background: #050505; color: #fff; }

.mobile-menu {
  display: none;
  place-items: center;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 22;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
}

body.home-view {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
body.home-view .shell {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body.home-view .sidebar {
  min-height: 0;
  height: 100%;
  overflow: auto;
}
body.home-view .workspace {
  justify-content: flex-start;
  padding-top: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
body.home-view .app {
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: .35rem 1.25rem .45rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
body.home-view .composer {
  display: none;
}

.grok-home {
  text-align: center;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  max-height: 100%;
  gap: 0;
}
.grok-wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #050505;
  line-height: 1.05;
  flex: 0 0 auto;
}
.grok-wordmark span { color: var(--ice); }
.grok-wordmark img,
.grok-wordmark .fieldbot-mark {
  width: 160px;
  height: auto;
  max-width: min(160px, 70vw);
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  background: transparent;
  box-shadow: none;
}
.grok-sub {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .82rem;
  flex: 0 0 auto;
}
.grok-money {
  margin-top: 1.05rem;
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  gap: .45rem;
  justify-content: center;
  flex-wrap: wrap;
}
.grok-money a { color: var(--muted); }
.grok-money a:hover { color: var(--ink); }
.grok-dot { color: var(--faint); }

.home-money-strip {
  margin: .4rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem 1.25rem;
  align-items: start;
  max-width: 24rem;
  width: 100%;
  padding: 0 .5rem;
  flex: 0 0 auto;
}
.home-money-side {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.home-money-side:first-child { text-align: left; }
.home-money-side:last-child { text-align: right; }
.home-money-side b {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.home-money-side span {
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.home-money-side em {
  font-style: normal;
  color: var(--faint);
  font-size: .6rem;
  font-variant-numeric: tabular-nums;
}
.home-money-side:hover { color: var(--ink); }
.home-money-side:hover span { color: var(--ink); }

/* Viewport-fit plus: seats + slim center */
.home-loop {
  --center-size: 3.15rem;
  --seat-size: 8.75rem;
  --ring-radius: 11.6rem;
  --seat-n: 4;
  position: relative;
  width: calc(var(--ring-radius) * 2 + var(--seat-size));
  height: calc(var(--ring-radius) * 2 + var(--seat-size));
  margin: .45rem auto 0;
  max-width: 100%;
  flex: 0 0 auto;
}
.home-seat {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  padding: .28rem .28rem .32rem;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgba(5, 5, 5, 0.04), 0 8px 22px rgba(5, 5, 5, 0.05);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  text-align: center;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
  cursor: pointer;
  z-index: 1;
}
.home-seat-orbit {
  width: var(--seat-size);
  height: var(--seat-size);
  --angle: calc((var(--i) * 360deg / var(--seat-n)) - 90deg);
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translate(var(--ring-radius))
    rotate(calc(-1 * var(--angle)));
}
.home-seat-center {
  width: var(--center-size);
  height: var(--center-size);
  padding: .35rem;
  z-index: 2;
  cursor: default;
  transform: translate(-50%, -50%);
  border-color: rgba(5, 5, 5, 0.14);
  box-shadow: 0 1px 2px rgba(5, 5, 5, 0.05), 0 10px 26px rgba(5, 5, 5, 0.06);
}
a.home-seat:hover {
  border-color: rgba(5, 5, 5, 0.22);
  box-shadow: 0 2px 4px rgba(5, 5, 5, 0.06), 0 12px 28px rgba(5, 5, 5, 0.08);
  color: var(--ink);
}
.home-seat-avatar {
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #F3F4F6;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
}
.home-seat-avatar svg {
  width: 58%;
  height: 58%;
  display: block;
}
.home-seat-label {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  max-width: 100%;
  padding: 0 .2rem;
}
.home-seat-count {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.home-seat-dollars {
  color: var(--muted);
  font-size: .58rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-pl-pct {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.home-pl-pct.pos { color: var(--ok); }
.home-pl-pct.neg { color: var(--bad); }
.home-pl-label {
  margin-top: .05rem;
  color: var(--muted);
  font-size: .48rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.home-money-chart {
  margin: .4rem auto 0;
  max-width: 30rem;
  width: 100%;
  padding: .35rem .75rem .2rem;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(5, 5, 5, 0.03);
  flex: 0 0 auto;
}
.home-chart-legend {
  display: flex;
  justify-content: center;
  gap: .85rem;
  margin-bottom: .15rem;
  font-size: .58rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.home-chart-legend span::before {
  content: "";
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  margin-right: .35rem;
  vertical-align: middle;
}
.home-chart-legend .lg-sales::before { background: var(--ice); }
.home-chart-legend .lg-receipts::before { background: var(--ok); }
.home-chart-legend .lg-costs::before { background: var(--bad); }
.home-chart-grid { stroke: var(--line); stroke-width: 1; }
.home-chart-sales { stroke: var(--ice); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.home-chart-receipts { stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.home-chart-costs { stroke: var(--bad); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.home-chart-label { fill: var(--faint); font-size: 9px; }

@media (max-width: 640px) {
  .home-money-strip {
    grid-template-columns: 1fr;
    gap: .65rem;
    max-width: 18rem;
  }
  .home-money-side:first-child,
  .home-money-side:last-child { text-align: center; }
  .home-loop {
    --center-size: 2.85rem;
    --seat-size: 7.25rem;
    --ring-radius: 9.6rem;
    margin-top: .35rem;
  }
  .home-seat-avatar { width: 62%; }
  .home-seat-label { font-size: .58rem; }
  .home-seat-count { font-size: .92rem; }
  .home-seat-dollars { font-size: .52rem; }
  .home-pl-pct { font-size: .92rem; }
  .home-pl-label { font-size: .5rem; }
}


.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.sub { color: var(--muted); font-size: .9rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.card.tap { cursor: pointer; }
.card.tap:hover { border-color: var(--line-2); }
.empty { color: var(--muted); font-size: .92rem; }
.meta {
  color: var(--muted);
  font-size: .78rem;
  display: flex;
  gap: .5rem .7rem;
  flex-wrap: wrap;
}
.title { font-weight: 600; margin: .2rem 0 .3rem; }
.body { white-space: pre-wrap; color: var(--ink); }
.stat b { display: block; font-size: 1.45rem; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: .78rem; }

.flag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: .08rem .55rem;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.flag.block { color: var(--block); border-color: rgba(226, 74, 64, 0.35); }
.flag.money { color: var(--money); border-color: rgba(26, 122, 92, 0.28); }
.flag.high { color: var(--warn); }
.flag.stage { color: var(--steel); }
.flag.warn { color: var(--warn); border-color: rgba(166, 124, 0, 0.28); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: .55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid #0B1F3A;
  background: transparent;
  color: #0B1F3A;
  cursor: pointer;
  letter-spacing: .02em;
}
.btn:hover { border-color: #2B7FFF; color: #2B7FFF; }
.btn-primary {
  background: #2B7FFF;
  border-color: #2B7FFF;
  color: #fff;
}
.btn-primary:hover {
  background: #0B1F3A;
  border-color: #0B1F3A;
  color: #fff;
}
.btn-danger { background: transparent; border-color: rgba(226, 74, 64, 0.45); color: #e24a40; }
.btn-done {
  display: block;
  width: 100%;
  margin-top: .55rem;
  min-height: 40px;
  padding: .4rem .55rem;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  background: #111111;
  border: 1px solid #111111;
  border-radius: 999px;
}
.btn-done:hover { color: #fff; background: #050505; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

.kanban {
  display: flex;
  gap: .7rem;
  overflow-x: auto;
  padding-bottom: .6rem;
  scroll-snap-type: x proximity;
}
.col {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .65rem;
  min-height: 12rem;
}
.col h2 { display: flex; justify-content: space-between; gap: .4rem; }
.col .count { color: var(--faint); }
.pkt {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .8rem;
  margin-bottom: .55rem;
  cursor: pointer;
}
.pkt:hover { border-color: var(--line-2); }
.pkt .name { font-weight: 600; }
.urgent-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: default;
}
.urgent-main { flex: 1; min-width: 0; color: inherit; }
.urgent-main:hover { color: inherit; }
.urgent-done { flex: 0 0 auto; white-space: nowrap; }
.urgent-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.urgent-dispatch {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  white-space: nowrap;
}
.urgent-dispatch:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.dispatch-meta { margin: 0 0 1rem; }
.dispatch-addr { color: var(--muted); font-size: .9rem; }
.dispatch-urgent { font-weight: 600; margin-top: .25rem; }
.dispatch-section {
  border-top: 1px solid var(--line);
  padding: .95rem 0 .35rem;
}
.dispatch-h {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 .65rem;
  font-weight: 600;
}
.dispatch-route-btns {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.dispatch-phone-row {
  display: flex;
  gap: .45rem;
  align-items: stretch;
}
.dispatch-phone-row input { flex: 1; }
.dispatch-phone-row .btn { flex: 0 0 auto; white-space: nowrap; }
.dispatch-contacts {
  margin-top: .45rem;
  max-height: 12rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.dispatch-contact-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: .55rem .7rem;
  cursor: pointer;
  color: inherit;
}
.dispatch-contact-item:last-child { border-bottom: 0; }
.dispatch-contact-item:hover { background: rgba(37, 99, 235, 0.06); }
.dispatch-contact-item .name { font-weight: 600; display: block; }
.dispatch-contact-item .meta { color: var(--muted); font-size: .82rem; }
.dispatch-status { margin: .55rem 0 0; font-size: .88rem; }
.dispatch-status.ok { color: var(--ok, #15803d); }
.dispatch-status.err { color: var(--bad, #e24a40); }
.dispatch-note { color: var(--muted); font-size: .88rem; margin: 0 0 .55rem; }
/* Event Text / Dispatch (edit modal) */
.ev-sms-block {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line, rgba(255,255,255,.08));
}
.ev-sms-h { margin: 0 0 .4rem; font-size: .95rem; }
.ev-sms-contacts {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line, rgba(255,255,255,.1));
  border-radius: 8px;
  padding: .35rem .5rem;
}
.ev-sms-contact {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  padding: .4rem 0;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.06));
  cursor: pointer;
  font-size: .9rem;
}
.ev-sms-contact:last-child { border-bottom: 0; }
.ev-sms-contact input { margin-top: .2rem; }
.ev-sms-contact .name { font-weight: 600; display: block; }
.ev-sms-contact .meta { color: var(--muted); font-size: .82rem; }
.ev-sms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .25rem;
}
.ev-sms-actions .btn { flex: 1 1 140px; }

.dispatch-gate {
  margin-top: .55rem;
  padding: .65rem .75rem;
  border: 1px solid rgba(226, 74, 64, 0.35);
  border-radius: 12px;
}
.dispatch-gate p { margin: 0 0 .55rem; color: var(--muted); font-size: .88rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--faint); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.neg { color: var(--bad); }
.amt.pos { color: var(--ok); }

.tabs { display: flex; gap: .3rem; overflow-x: auto; margin: .8rem 0 1rem; }
.tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: .45rem .8rem;
  min-height: 40px;
  white-space: nowrap;
  cursor: pointer;
}
.tab.on { color: var(--ink); border-color: var(--ink); }

.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .75rem; }
.field label { color: var(--faint); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
input, select, textarea {
  background: #FFFFFF;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: .65rem .7rem;
  min-height: var(--tap);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--glow);
}
textarea { min-height: 120px; resize: vertical; }
.search-box { display: flex; gap: .55rem; margin-bottom: 1.35rem; }
.search-box input { flex: 1; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, .4);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: .6rem;
}
.modal[hidden] { display: none; }
.sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 1.15rem 1.15rem 1.3rem;
  box-shadow: 0 24px 80px rgba(5, 5, 5, .12);
}
.sheet h1 { font-size: 1.05rem; }

.ph {
  border-radius: 12px;
  min-height: 140px;
  padding: .8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.ph .tag { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ph.before, .ph.progress, .ph.problem, .ph.completed, .ph.co_support, .ph.file { background: var(--bg-2); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .65rem; }

.login-body {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(1.2rem, env(safe-area-inset-top, 0px)) 1.2rem max(2rem, env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.login-card {
  width: min(400px, 100%);
  max-width: 400px;
  overflow: hidden;
  margin: 0 auto 2rem;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.1rem 1.7rem 1.7rem;
  box-shadow: none;
  text-align: center;
}
.login-kicker { color: var(--muted); margin: .55rem 0 0; font-size: .95rem; }
.login-hint {
  color: var(--faint);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 1.2rem 0 .4rem;
}
.login-error { color: var(--bad); display: none; margin: 0 0 .7rem; font-weight: 700; }
.login-error.show { display: block; }
html[data-error="1"] .login-error#err,
html[data-error="1"] .login-error#errCrew,
html[data-error="2"] .login-error#err2 { display: block; }
.crew-login-body .login-card { border: 2px solid var(--accent, #2B7FFF); }
.crew-login-title {
  margin: .35rem 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.crew-login-note {
  color: var(--muted, #8b95a3);
  font-size: .85rem;
  line-height: 1.45;
  margin: .85rem 0 0;
  text-transform: none;
  letter-spacing: 0;
}
.crew-login-note a { color: inherit; text-decoration: underline; }
.login-form { text-align: left; margin-top: 1.1rem; }
.login-form label {
  display: block;
  color: var(--faint);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.login-form .btn-primary { margin-top: 1rem; }

/* —— Landing (logged-out /) —— */
.landing-body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}
.landing {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 2rem 1.25rem 3.2rem;
}
.landing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1.6rem;
}
.landing-top .brand-lg { margin: 0; align-items: center; text-align: center; }
.landing-top .fieldbot-mark-lg {
  width: 200px;
  max-width: min(200px, calc(100vw - 9rem));
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
/* Login owl hard-cap: beat .fieldbot-mark-lg { width:240px } without !important */
.login-body .fieldbot-mark,
.login-body .fieldbot-mark.fieldbot-mark-lg,
.login-card .fieldbot-mark,
.login-card .fieldbot-mark.fieldbot-mark-lg,
.login-card .brand img,
.hq-card .fieldbot-mark,
.hq-card .fieldbot-mark.fieldbot-mark-lg,
.hq-login-body .fieldbot-mark,
.hq-login-body .fieldbot-mark.fieldbot-mark-lg {
  width: 140px;
  max-width: min(140px, 56vw);
  height: auto;
  object-fit: contain;
  object-position: center;
  overflow: visible;
  margin: 0 auto .15rem;
}
.login-card .brand,
.hq-card .brand {
  overflow: visible;
  max-width: 100%;
}
.welcome-brand img,
.welcome-brand .fieldbot-mark {
  width: auto;
  max-width: 140px;
  height: auto;
}
.landing-login-top {
  flex: 0 0 auto;
  text-decoration: none;
  padding: .45rem 1rem;
  font-weight: 650;
  white-space: nowrap;
}
.landing-hero {
  text-align: center;
  margin-bottom: 2.4rem;
}
.landing-hero h1 {
  margin: 0;
  font-size: clamp(1.85rem, 5.2vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-transform: none;
  color: var(--ink);
}
.landing-subhead {
  margin: 1rem auto 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}
.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: center;
  margin-top: 1.45rem;
}
.landing-cta-row .btn {
  text-decoration: none;
  text-align: center;
  min-width: min(100%, 14.5rem);
}
.btn-lg {
  min-height: 50px;
  padding: .7rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
}
.btn-outline {
  background: transparent;
  border: 2px solid #0B1F3A;
  color: #0B1F3A;
  font-weight: 600;
}
.btn-outline:hover {
  background: transparent;
  border-color: #2B7FFF;
  color: #2B7FFF;
}
.landing-cta-row .btn:not(.btn-primary) {
  background: transparent;
  border: 2px solid #0B1F3A;
  color: #0B1F3A;
  font-weight: 600;
}
.landing-cta-row .btn:not(.btn-primary):hover {
  background: transparent;
  border-color: #2B7FFF;
  color: #2B7FFF;
}
.landing-trust {
  margin: 1rem 0 0;
  color: var(--faint);
  font-size: .9rem;
  letter-spacing: .01em;
}
.landing-section {
  margin-top: 2rem;
  padding: 1.45rem 1.35rem 1.4rem;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.landing-section-title {
  margin: 0 0 1rem;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.landing-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.landing-steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .85rem;
  align-items: start;
}
.landing-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #2B7FFF;
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  flex: 0 0 auto;
}
.landing-steps strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.landing-steps p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.45;
}
.landing-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .65rem;
}
.landing-benefits li {
  position: relative;
  padding-left: 1.45rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}
.landing-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55rem;
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: #2B7FFF;
}
.landing-action-now {
  text-align: center;
  border-color: rgba(43, 127, 255, 0.28);
  background: #FFFFFF;
}
.landing-action-now .landing-section-title {
  color: #2B7FFF;
}
.landing-navy {
  background: #0B1F3A;
  border-color: #0B1F3A;
  color: #FFFFFF;
}
.landing-navy .landing-section-title { color: #2B7FFF; }
.landing-navy .landing-steps strong { color: #FFFFFF; }
.landing-navy .landing-steps p { color: rgba(248, 250, 252, 0.78); }
.landing-navy .landing-step-n { background: #2B7FFF; color: #fff; }
.landing-navy .landing-note {
  color: rgba(248, 250, 252, 0.72);
  text-align: center;
}
.landing-note a,
.landing-blurb a,
.login-card a,
.landing-signin a { color: #2B7FFF; }
.landing-note a:hover,
.landing-blurb a:hover,
.login-card a:hover { color: #0B1F3A; }
.landing-blurb {
  margin: .75rem 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
}
.landing-blurb-lg {
  margin: 0 auto;
  max-width: 28rem;
  font-size: 1.05rem;
  color: var(--ink);
}
.landing-action-now .landing-cta-row { margin-top: 1.2rem; }
.landing-note {
  margin: 1.1rem 0 0;
  color: var(--faint);
  font-size: .85rem;
  line-height: 1.45;
}
.landing-note a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.landing-note a:hover { color: var(--ink); }
.landing-eyebrow {
  margin: 0 0 .55rem;
  color: var(--faint);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
}
.landing-signin-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  line-height: 1.25;
}
.landing-signin .login-form { margin-top: 1rem; }
.landing-signin .login-error { text-align: left; margin-top: .85rem; }
.landing-signin code {
  font-size: .88em;
  padding: .1rem .35rem;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

@media (max-width: 560px) {
  .landing { padding: 1.35rem 1rem 2.6rem; }
  .landing-hero { margin-bottom: 1.75rem; }
  .landing-section { padding: 1.25rem 1.1rem 1.2rem; }
  .landing-cta-row { flex-direction: column; }
  .landing-cta-row .btn { width: 100%; min-width: 0; }
  .landing-signin-title { font-size: 1.2rem; }
}


.std { white-space: pre-wrap; color: var(--ink); }
.std-block + .std-block { margin-top: 1rem; }

.home-wrap { max-width: 640px; margin: 0 auto; }
.bins { display: grid; gap: .85rem; }
.bins-split { grid-template-columns: 1fr 1fr; align-items: start; }
.bin-col { display: grid; gap: .85rem; }
.bin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--chat-sliver, 108px);
  padding: 1.15rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
}
.bin:hover { border-color: var(--line-2); color: var(--ink); }
.bin-name { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.bin-count { font-size: 1.55rem; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: -0.03em; }
.pkt-list { display: flex; flex-direction: column; gap: .55rem; }
.folder-section { margin: 0 0 1.15rem; }
.folder-section h2 {
  margin: 0 0 .65rem;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.back { display: inline-block; color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .4rem; }
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem 1.1rem;
  margin: 1rem 0 .5rem;
  color: var(--ink);
}
.facts b { display: block; color: var(--faint); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.stack { margin-top: 1.8rem; }
.stack h2 { margin-bottom: .65rem; }

.bin-right { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.bin-dollars { color: var(--muted); font-size: .85rem; }
.money-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin: 0 0 1.2rem; }
.money-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: var(--ink);
}
.money-card:hover { border-color: var(--line-2); color: var(--ink); }
.money-card b { display: block; font-size: 1.15rem; font-weight: 550; letter-spacing: -0.02em; }
.money-card span { color: var(--muted); font-size: .75rem; letter-spacing: .04em; }
.map { height: 62vh; min-height: 320px; border-radius: var(--radius); border: 1px solid var(--line); margin-top: .7rem; background: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .7rem; color: var(--muted); }
.chip.on { color: var(--ink); border-color: var(--ink); }

.home-links { display: flex; gap: 1.2rem; margin-top: 1.4rem; }
.home-links a { color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; }
.home-links a:hover { color: var(--ink); }
.flag-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.hard-warn {
  background: rgba(226, 74, 64, 0.06);
  border: 1px solid rgba(226, 74, 64, 0.35);
  color: #9b2c24;
  padding: .95rem 1.05rem;
  border-radius: var(--radius);
  margin-bottom: .9rem;
}
.hard-warn strong { display: block; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .35rem; font-size: .72rem; }
.status-picker { margin-bottom: 1rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form label { color: var(--faint); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.inline-form select { width: auto; min-width: 160px; }
.pkt-actions { margin-bottom: .5rem; }
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: .5rem;
  margin-top: .9rem;
  overflow-x: auto;
}
.day-col {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .5rem;
  min-height: 8rem;
  min-width: 150px;
  overflow: visible;
}
.day-col .pkt { cursor: pointer; overflow: visible; }
.day-col .pkt .meta { display: none; }
.pin-red { background: transparent; border: 0; }
.pin-red span {
  display: block;
  width: 14px;
  height: 14px;
  background: #e24a40;
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(226, 74, 64, 0.25);
}

.month-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: .9rem; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
  gap: 2px;
  min-width: 100%;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.month-dow {
  background: var(--bg-2);
  color: var(--faint);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
  padding: .45rem .2rem;
}
.month-cell {
  background: var(--panel);
  min-width: 40px;
  min-height: 92px;
  padding: .35rem .3rem .4rem;
  overflow: visible;
}
.month-cell.out { background: var(--bg-2); color: var(--faint); }
.month-cell.out .month-num { color: var(--faint); }
.month-cell.today {
  box-shadow: inset 0 0 0 1px var(--ink);
  background: rgba(5, 5, 5, 0.03);
}
.month-num {
  font-size: .78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: .3rem;
  color: var(--ink);
}
.month-cell .pkt { padding: .35rem .4rem .4rem; margin-bottom: .35rem; overflow: visible; }
.month-cell .pkt:last-child { margin-bottom: 0; }
.month-cell .pkt .name {
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.month-cell .pkt .meta { display: none; }
.month-cell .btn-done {
  width: 100%;
  min-height: 28px;
  margin-top: .28rem;
  padding: .18rem .2rem;
  font-size: .56rem;
  letter-spacing: .08em;
  white-space: normal;
  line-height: 1.15;
}

.plans-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 1.15rem;
  padding: 1rem 1.15rem;
  min-height: var(--chat-sliver, 108px);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.plans-bar-label {
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.plans-bar a.btn, .plans-bar a.btn-primary {
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 10rem;
  padding: 0.65rem 1.15rem;
  background: #2B7FFF;
  border: 1px solid #2B7FFF;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.plans-bar a.btn:hover, .plans-bar a.btn-primary:hover { background: #0B1F3A; border-color: #0B1F3A; color: #fff; }
.file-list { display: flex; flex-direction: column; gap: 0.5rem; }
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  min-height: 56px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.file-row .btn { min-width: 5.5rem; }

.bin-urgent { border-color: #e24a40; }
.bin-urgent .bin-name {
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .92rem;
  color: #e24a40;
}

.urgent-strip {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin: 0 0 1rem;
  padding: .42rem .85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid #e24a40;
  border-radius: var(--radius);
}
.urgent-strip.is-empty { align-items: center; padding: .22rem .75rem; min-height: 0; }
.urgent-mark {
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #e24a40;
  font-weight: 650;
  flex: 0 0 auto;
  padding-top: .12rem;
}
.urgent-strip.is-empty .urgent-mark { color: var(--faint); padding-top: 0; }
.urgent-list { flex: 1; display: flex; flex-direction: column; gap: .28rem; }
.urgent-title { font-weight: 600; font-size: .92rem; }
.urgent-body { color: var(--muted); font-size: .82rem; white-space: pre-wrap; }

.pkt-head { width: 100%; }
.pkt-main { flex: 1 1 100%; min-width: 0; }
.pkt-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.pkt-title-row h1 { flex: 1 1 auto; min-width: 0; }
.next-steps {
  flex: 0 0 240px;
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .65rem .8rem .7rem;
}
.next-steps-title {
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: .4rem;
}
.step-line { display: flex; gap: .5rem; font-size: .86rem; padding: .1rem 0; line-height: 1.4; }
.step-n { color: var(--ink); font-variant-numeric: tabular-nums; width: 1rem; flex: 0 0 auto; }
.step-text.dash { color: var(--faint); }

.pl-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .55rem .8rem;
  margin: .85rem 0 1rem;
  padding: .7rem .9rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pl-strip.mini { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pl-strip b {
  display: block;
  color: var(--faint);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
}
.pl-strip span { font-variant-numeric: tabular-nums; font-size: .95rem; }
.compact-facts { margin: .4rem 0 0; }

.step-head, .sub-head {
  display: grid;
  gap: .4rem .5rem;
  padding: 0 .65rem .35rem;
  color: var(--faint);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.step-head { grid-template-columns: 7.5rem minmax(8rem, 1.4fr) 5.2rem 5.2rem 4.5rem 5.5rem 7.2rem auto; }
.sub-head { grid-template-columns: 7rem 8rem 1fr 7rem 1fr 4.2rem 4.2rem 4.2rem auto; }
.step-row, .sub-row {
  display: grid;
  gap: .4rem .5rem;
  align-items: center;
  padding: .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: .4rem;
}
.step-row { grid-template-columns: 7.5rem minmax(8rem, 1.4fr) 5.2rem 5.2rem 4.5rem 5.5rem 7.2rem auto; }
.sub-row { grid-template-columns: 7rem 8rem 1fr 7rem 1fr 4.2rem 4.2rem 4.2rem auto; }
.step-row input, .sub-row input, .step-row select, .sub-row select { min-height: 40px; padding: .4rem .45rem; }
.step-name { font-weight: 550; font-size: .88rem; }
.step-row.current { border-color: var(--ink); }
.step-row.overdue { border-color: rgba(226, 74, 64, 0.5); }
.sub-row.paper-miss { border-color: rgba(166, 124, 0, 0.4); }
.tiny {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  color: var(--faint);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.check-row { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.subhead {
  margin: 1.1rem 0 .45rem;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.repeat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
  margin-bottom: .45rem;
}
.company-wrap { max-width: 720px; }

.pkt-live { max-width: 760px; }
.pkt-live-head {
  position: sticky;
  top: 44px;
  z-index: 15;
  margin: -1.6rem -1.15rem 0;
  padding: 0.85rem 1.15rem 0.95rem;
  background: rgba(252, 252, 252, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.pkt-live-head .back { display: inline-block; }
.pkt-live-head h1 { margin: 0 0 0.45rem; }
.pkt-live-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1.1rem; }
.pkt-live-facts b {
  display: block;
  color: var(--faint);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
}
.pkt-progress { color: var(--ink); font-variant-numeric: tabular-nums; }
.pkt-live .always-open { margin-top: 1.35rem; }
.pkt-live .always-open h2 { margin-bottom: 0.55rem; }

.file-links { list-style: none; padding: 0; margin: 0; }
.file-links li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.85rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.file-links li:last-child { border-bottom: 0; }
.file-links a { word-break: break-word; }

.feed-item { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }

.acc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin: 0.7rem 0;
}
.acc > summary {
  list-style: none;
  cursor: pointer;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: "+"; color: var(--ink); font-size: 1.15rem; font-weight: 400; line-height: 1; }
.acc[open] > summary::after { content: "–"; }
.acc > summary:hover { color: var(--ink); }
.acc-body { padding: 0 1rem 1rem; }

.step-row.ro, .ro-head { grid-template-columns: 7.5rem minmax(8rem, 1.4fr) 7rem 7rem; }
.sub-row.ro, .ro-sub-head { grid-template-columns: 7rem 8rem 1fr 8rem 1fr auto; }
a.ph { color: inherit; display: flex; flex-direction: column; justify-content: flex-end; }

.contacts-wrap { max-width: 640px; }
.contact-list { display: flex; flex-direction: column; }
.contact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
  cursor: default;
  color: inherit;
}
.contact-row:last-child { border-bottom: 0; }
.contact-main { flex: 1; min-width: 0; cursor: pointer; }
.contact-row .name { font-weight: 600; font-size: 1.02rem; }
.contact-main:hover .name { color: #000; }
.contact-phone { color: var(--muted); font-size: .88rem; margin-top: .12rem; }
.contact-job { color: var(--faint); font-size: .78rem; margin-top: .08rem; }
.contact-extra { color: var(--faint); font-size: .78rem; margin-top: .08rem; }
.contact-edit-btn { flex-shrink: 0; margin-top: .1rem; }
.contact-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #111111;
  color: #fff;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
  padding: 0;
  margin-top: .15rem;
  box-shadow: 0 1px 2px rgba(5, 5, 5, 0.08);
}
.contact-add-btn:hover { background: #050505; color: #fff; }
.contact-add-btn:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}
.contact-edit-form .field { margin-bottom: .7rem; }

.addr-ac-wrap { position: relative; }
.addr-ac-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(5, 5, 5, .12);
  max-height: 220px;
  overflow: auto;
  padding: .25rem;
}
.addr-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: .55rem .65rem;
  min-height: 40px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.addr-ac-item:hover,
.addr-ac-item.on { background: var(--bg-2); }
/* Google Places dropdown above contact edit modal */
.pac-container { z-index: 10000 !important; }

.contact-edit-actions { margin-top: .4rem; justify-content: flex-end; gap: .5rem; }
.contact-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem .95rem;
}
.contact-card.has-link { cursor: pointer; }
.contact-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.contact-last { color: var(--muted); font-size: .82rem; margin-top: .35rem; }

.conv-wrap { max-width: 560px; }
.conv-wrap.conv-split,
.conv-wrap.imsg-inbox { max-width: 1100px; }
.imsg-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
.imsg-inbox-grid {
  display: grid;
  grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  min-height: 0;
}
.imsg-list-col,
.imsg-thread-col {
  min-width: 0;
  min-height: 0;
  max-height: calc(100dvh - 168px);
  overflow: auto;
  overscroll-behavior: contain;
}
.imsg-thread-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.imsg-thread-col .imsg-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-top: 0.85rem;
  scroll-padding-top: 0.85rem;
}
.imsg-thread-empty { display: grid; place-items: center; }
.imsg-row.on { background: rgba(43, 127, 255, 0.08); }
.imsg-row.unread .name { font-weight: 700; }
.imsg-chans { display: flex; flex-wrap: wrap; gap: .28rem; margin-top: .28rem; }
.imsg-chan {
  display: inline-block;
  padding: .08rem .42rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: rgba(11, 31, 58, 0.06);
  color: var(--muted);
}
.imsg-chan-call { background: rgba(226, 74, 64, 0.12); color: #b42318; }
.imsg-chan-email { background: rgba(43, 127, 255, 0.12); color: #1d4ed8; }
.imsg-chan-web { background: rgba(43, 127, 255, 0.14); color: #0B1F3A; }
.webchat-snippet {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0B1F3A;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
}
.imsg-unread {
  flex: 0 0 auto;
  align-self: center;
  min-width: 1.2rem;
  margin-left: .55rem;
  padding: .08rem .38rem;
  border-radius: 999px;
  background: #007AFF;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
}
.bubble-chan {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: .18rem;
}
.bubble-subject { font-weight: 650; margin-bottom: .2rem; }
.bubble-email { box-shadow: inset 0 0 0 1px rgba(43, 127, 255, 0.22); }
.imsg-client-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.imsg-client-link:hover,
.imsg-client-link:focus-visible {
  border-bottom-color: currentColor;
  outline: none;
}
.imsg-pane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .15rem .9rem .55rem;
  background: #FFFFFF;
}
.imsg-pane.missed { border-color: rgba(226, 74, 64, 0.28); }
.imsg-list { display: flex; flex-direction: column; }
.imsg-section {
  margin: .95rem 0 .1rem;
  padding: .35rem 0 .2rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.imsg-section:first-child { margin-top: .1rem; }
.imsg-section.quiet { color: var(--faint); margin-top: 1.2rem; }
.imsg-row {
  display: flex;
  align-items: stretch;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.imsg-row:last-child { border-bottom: 0; }
.imsg-row:hover .name { color: #000; }
.imsg-row-act {
  flex: 0 0 auto;
  align-self: center;
  margin-left: .45rem;
}
.imsg-row-act .btn,
.imsg-del {
  min-height: 40px;
  padding: .35rem .65rem;
  font-size: .8rem;
}
.imsg-row-box {
  display: flex;
  align-items: center;
  gap: .45rem;
  border-bottom: 1px solid var(--line);
}
.imsg-row-box .imsg-row { flex: 1; min-width: 0; border-bottom: 0; }
.imsg-row-box:last-child { border-bottom: 0; }
.row-acts { white-space: nowrap; text-align: right; }
.row-acts .btn { min-height: 36px; margin-left: .25rem; padding: .3rem .55rem; }
@media (max-width: 860px) {
  .imsg-row-act .btn,
  .imsg-del,
  .row-acts .btn { min-height: 44px; }
}
.imsg-row-main { flex: 1; min-width: 0; }
.imsg-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.imsg-row .name { font-weight: 600; font-size: 1.02rem; }
.imsg-time { color: var(--faint); font-size: .75rem; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.imsg-preview {
  color: var(--muted);
  font-size: .88rem;
  margin-top: .18rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.imsg-head {
  position: sticky;
  top: 0;
  flex: 0 0 auto;
  z-index: 12;
  margin: 0 0 .35rem;
  padding: .55rem 0 .7rem;
  background: rgba(252, 252, 252, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.imsg-head h1,
.imsg-head-name { margin-bottom: .15rem; }
.imsg-contact-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.imsg-contact-link:hover,
.imsg-contact-link:focus-visible {
  border-bottom-color: currentColor;
  outline: none;
}
.imsg-head-name-plain { cursor: default; }
.contact-row-focus {
  background: rgba(37, 99, 235, 0.08);
  box-shadow: inset 3px 0 0 #2563eb;
}
body.conv-view .thread-wrap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.conv-view .thread-wrap .imsg-inbox-grid {
  flex: 1 1 auto;
  min-height: 0;
}
body.conv-view .thread-wrap .imsg-thread-col {
  overflow: hidden;
  min-height: 0;
}
body.conv-view .thread-wrap .imsg-head {
  position: sticky;
  top: 0;
  flex: 0 0 auto;
}
body.conv-view .thread-wrap .imsg-thread {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding-top: 0.85rem;
  scroll-padding-top: 0.85rem;
}
.imsg-job { display: inline-block; margin-top: .45rem; color: var(--ink); font-size: .82rem; }
.imsg-thread { display: flex; flex-direction: column; gap: .55rem; padding: .85rem 0 1.5rem; scroll-padding-top: .85rem; }
.imsg-thread .bubble-row:first-child { scroll-margin-top: .85rem; }
.imsg-thread-scroll { padding-top: 0.85rem; scroll-padding-top: 0.85rem; }
.imsg-text-btn {
  flex: 0 0 auto;
  align-self: center;
  margin-left: .65rem;
  padding: .28rem .7rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--muted);
  font-size: .8rem;
}
.imsg-text-btn:hover { color: var(--ink); border-color: var(--ink); }
.imsg-compose {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  margin-top: .85rem;
  padding: .4rem .45rem .4rem .95rem;
  background: #FFFFFF;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.imsg-compose textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  min-height: 1.5rem;
  max-height: 6.5rem;
  padding: .45rem 0;
  line-height: 1.4;
}
.imsg-compose textarea::placeholder { color: var(--faint); }
.imsg-compose .btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: .4rem 1.05rem;
}
.imsg-compose-err { margin: .45rem 0 0; color: var(--bad); font-size: .88rem; }
.imsg-compose-missing { margin: .85rem 0 0; color: var(--muted); font-size: .9rem; }
.bubble-row { display: flex; width: 100%; }
.bubble-row.in { justify-content: flex-start; }
.bubble-row.out { justify-content: flex-end; }
.bubble { max-width: 82%; padding: .62rem .85rem .5rem; border-radius: 18px; }
.bubble-row.in .bubble {
  background: #0A0A0A;
  border: 0;
  color: #050505;
  border-bottom-left-radius: 5px;
}
.bubble-row.out .bubble {
  background: #007AFF;
  border: 0;
  color: #fff;
  border-bottom-right-radius: 5px;
}
.bubble-body { white-space: pre-wrap; word-break: break-word; font-size: .95rem; line-height: 1.4; }
.bubble-meta { margin-top: .28rem; color: var(--faint); font-size: .68rem; letter-spacing: .01em; }
.bubble-row.out .bubble-meta { color: rgba(255, 255, 255, 0.72); text-align: right; }
.bubble-call { border-left: 3px solid #e24a40; }
.bubble-row.in .bubble.bubble-call { background: #E3E3E8; }

@media (max-width: 900px) {
  .week-grid { grid-template-columns: 1fr; }
  .pl-strip, .pl-strip.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-head, .sub-head { display: none; }
  .step-row, .sub-row { grid-template-columns: 1fr 1fr; padding: .7rem .75rem; }
  .step-row .step-name, .sub-row .step-name { grid-column: 1 / -1; font-size: .95rem; }
  .step-row .btn, .sub-row .btn { grid-column: 1 / -1; }
  .repeat-row { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { padding: .55rem 0; border-bottom: 1px solid var(--line); }
  td { padding: .15rem 0; border: 0; }
  td::before { content: attr(data-label); display: block; color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
  .facts { grid-template-columns: 1fr; }
  .money-cards { grid-template-columns: 1fr; }
  .plans-bar { flex-direction: column; align-items: stretch; width: 100%; min-height: 0; padding: 1rem; }
  .plans-bar a.btn, .plans-bar a.btn-primary { width: 100%; min-height: 52px; }
  .pkt-title-row { flex-direction: column; }
  .next-steps { flex: 1 1 auto; width: 100%; }
  .pkt-live { max-width: none; }
  .pkt-live-head { top: 0; margin-left: -1.15rem; margin-right: -1.15rem; }
  .pkt-live-facts { grid-template-columns: 1fr; }
  .ro-head, .ro-sub-head { display: none; }
  .step-row.ro, .sub-row.ro { grid-template-columns: 1fr 1fr; }
  .contact-top { flex-direction: column; align-items: flex-start; }
  .conv-wrap { max-width: none; }
  .imsg-split,
  .imsg-inbox-grid { grid-template-columns: 1fr; }
  .imsg-list-col,
  .imsg-thread-col { max-height: none; }
  body.conv-view .thread-wrap .imsg-list-col { display: none; }
  body.conv-view .thread-wrap .imsg-thread-col {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.conv-view .thread-wrap .imsg-head {
    position: sticky;
    top: 0;
    flex: 0 0 auto;
  }
  body.conv-view .thread-wrap .imsg-thread {
    padding-top: 0.85rem;
    scroll-padding-top: 0.85rem;
    overflow: auto;
    min-height: 0;
  }
  .bubble { max-width: 88%; }
}

@media (max-width: 800px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 30;
    width: 252px;
    flex-basis: 252px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: none;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(5, 5, 5, 0.12);
  }
  body.sidebar-open .workspace::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.22);
    z-index: 28;
  }
  .mobile-menu { display: grid; }
  body.sidebar-open .mobile-menu { visibility: hidden; }
  body.home-view .workspace { padding-top: 2.75rem; }
  body.home-view .app { padding: .25rem 1rem .35rem; }
  .grok-wordmark { font-size: 28px; }
  .composer { width: calc(100% - 1.5rem); height: 56px; }
}

@media (max-width: 640px) {
  .bins-split { grid-template-columns: 1fr; }
}


/* Company brand preview */
.brand-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .35rem 0 .75rem;
}
.brand-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(5, 5, 5, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.brand-swatch-meta {
  font-size: .78rem;
  color: var(--muted);
  margin: 0 0 .75rem;
}

/* —— Trial desk + walkthrough —— */
.trial-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem .75rem;
  flex: 0 0 auto;
  padding: .35rem .85rem;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #c7cdd6;
  font-size: .8rem;
  line-height: 1.3;
  z-index: 5;
}
.trial-banner .trial-banner-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .65rem;
  min-width: 0;
  flex: 1 1 auto;
}
.trial-banner strong { color: #f3f4f6; font-weight: 650; }
.trial-banner .trial-phone { font-variant-numeric: tabular-nums; color: #9ca3af; }
.trial-banner a { color: #9ed8ea; }
.trial-banner .trial-sep { color: #6b7280; }
/* Keep home FIELDBOT wordmark as the hero — trial chrome stays a slim strip above */
body.home-view.has-trial-banner .grok-hero {
  padding-top: .35rem;
}
body.home-view.has-trial-banner .grok-wordmark {
  position: relative;
  z-index: 1;
}
@media (max-width: 800px) {
  body.has-trial-banner .mobile-menu {
    top: auto;
    /* sit just under the slim trial strip */
  }
  body.has-trial-banner .workspace {
    /* banner is in-flow; don't also invent colliding fixed chrome */
  }
  body.home-view.has-trial-banner .workspace {
    padding-top: 2.75rem; /* room for hamburger over content, banner already in flow above */
  }
  .trial-banner {
    padding: .4rem .7rem .4rem 3.4rem; /* clear the fixed hamburger */
    font-size: .76rem;
  }
}
.sidebar-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: auto;
  max-width: calc(100% - .4rem);
  margin: .2rem auto 0;
  padding: .16rem .55rem .18rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: rgba(255, 255, 255, 0.04);
  color: #94A3B8;
  font: inherit;
  font-size: .68rem;
  font-weight: 550;
  letter-spacing: .01em;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}
.sidebar-help:hover {
  color: #E2E8F0;
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.07);
}
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}
.tour-spotlight {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(5, 6, 8, 0.72);
  border: 2px solid rgba(158, 216, 234, 0.85);
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
  pointer-events: none;
}
.tour-card {
  position: fixed;
  z-index: 9001;
  width: min(360px, calc(100vw - 2rem));
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 12px;
  background: #0c0e12;
  border: 1px solid rgba(180, 210, 230, 0.18);
  color: #e8edf2;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.tour-step { margin: 0; color: #8b95a3; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.tour-title { margin: .35rem 0 .45rem; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.tour-body { margin: 0; color: #d5dce4; font-size: .92rem; line-height: 1.45; }
.tour-actions { display: flex; gap: .55rem; justify-content: flex-end; margin-top: 1rem; }
.tour-target-pulse { outline: 2px solid rgba(158, 216, 234, 0.9); outline-offset: 3px; }

body.tour-active { overscroll-behavior: none; }
body.tour-active .sidebar { position: relative; z-index: 9100; }
body.tour-active .welcome-card, body.tour-active .setup-form-card { position: relative; z-index: 9101; }

/* —— Welcome / first-run walkthrough landing —— */
body.welcome-view .composer,
body.welcome-view #topSearch { display: none !important; }
.welcome-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(72vh, 640px);
  padding: 1.5rem 1rem 2.5rem;
}
.welcome-card {
  width: min(440px, 100%);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(158, 216, 234, 0.22);
  background: linear-gradient(165deg, rgba(22, 30, 40, 0.98), rgba(14, 18, 24, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.welcome-brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  font-weight: 650;
  color: #8b95a3;
  margin-bottom: 0.85rem;
}
.welcome-brand span { color: #9ed8ea; }
.welcome-brand img,
.welcome-brand .fieldbot-mark {
  width: auto;
  max-width: 140px;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: center;
}
.welcome-card h1 {
  margin: 0 0 0.65rem;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f3f4f6;
}
.welcome-lead {
  margin: 0 0 0.65rem;
  color: #d5dce4;
  font-size: 0.98rem;
  line-height: 1.45;
}
.welcome-body {
  margin: 0 0 1rem;
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.45;
}
.welcome-list {
  margin: 0 0 1.25rem;
  padding: 0 0 0 1.1rem;
  color: #c7cdd6;
  font-size: 0.9rem;
  line-height: 1.55;
}
.welcome-list li { margin: 0.15rem 0; }
.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-start;
}
.welcome-actions .btn-primary { min-width: 10rem; }
@media (max-width: 800px) {
  .welcome-wrap { min-height: 60vh; padding-top: 3rem; }
  .welcome-card { padding: 1.35rem 1.15rem 1.25rem; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions .btn,
  .welcome-actions .btn-primary { width: 100%; }
}

@media (max-width: 800px) {
  body.tour-active.sidebar-open .sidebar {
    /* Keep drawer above workspace dim while tour spotlight measures it */
    z-index: 9100;
  }
  body.tour-active .tour-card {
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }
}


.trial-upgrade-btn {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid #2B7FFF;
  background: #2B7FFF;
  color: #fff;
  border-radius: 999px;
  padding: .28rem .8rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: none;
  text-shadow: none;
  white-space: nowrap;
}
.trial-upgrade-btn:hover {
  background: #0B1F3A;
  border-color: #0B1F3A;
  color: #fff;
}
.trial-upgrade-btn:disabled { opacity: .65; cursor: wait; filter: grayscale(.15); }
.trial-flash { color: #9ed8ea; }


/* —— Shop chat —— */
body.chat-view .composer { display: none; }
body.chat-view .app {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}
body.chat-view .workspace {
  overflow: hidden;
  min-height: 0;
  height: 100dvh;
  max-height: 100dvh;
}
body.chat-view {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.shop-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  background: #FCFCFC;
}
.shop-chat-head {
  flex: 0 0 auto;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.shop-chat-head h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: .02em;
}
.shop-chat-head .sub {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .85rem;
}
.shop-chat-head .ai-flag {
  display: inline-block;
  margin-top: .45rem;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .15rem .55rem;
}
.shop-chat-head .ai-flag.on { color: #0a7; border-color: #9dd; background: #f0fffa; }
.shop-chat-log {
  flex: 1 1 auto;
  overflow: auto;
  padding: 1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-height: 0;
}
.shop-chat-bubble {
  max-width: min(82%, 36rem);
  padding: .62rem .85rem .55rem;
  border-radius: 18px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .95rem;
  border: 0;
}
/* Match Conversations iMessage look: you = blue, FieldBot = gray */
.shop-chat-bubble.user {
  align-self: flex-end;
  background: #007AFF;
  color: #fff;
  border-bottom-right-radius: 5px;
}
.shop-chat-bubble.assistant {
  align-self: flex-start;
  background: #0A0A0A;
  color: #050505;
  border-bottom-left-radius: 5px;
  box-shadow: none;
}
.shop-chat-bubble.system {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  max-width: 28rem;
  padding: .35rem .5rem;
}
.shop-chat-form {
  flex: 0 0 auto;
  display: flex;
  gap: .55rem;
  align-items: flex-end;
  padding: .75rem 1rem 1.1rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.shop-chat-form textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 140px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  padding: .7rem .95rem;
  font: inherit;
  line-height: 1.35;
  background: #f5f5f7;
}
.shop-chat-form textarea:focus {
  outline: none;
  border-color: #007AFF;
  background: #fff;
}
.shop-chat-form button[type="submit"] {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: #007AFF;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  flex: 0 0 auto;
}
.shop-chat-form button[type="submit"]:disabled { opacity: .45; cursor: wait; }
.shop-chat-attach {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 48px;
  padding: .2rem .35rem;
  border: 1px solid var(--line);
  background: #fff;
  color: #007AFF;
  border-radius: 14px;
  cursor: pointer;
  flex: 0 0 auto;
  gap: .05rem;
  line-height: 1.05;
}
.shop-chat-attach:hover { border-color: #007AFF; background: #f2f8ff; }
.shop-chat-attach:disabled { opacity: .45; cursor: wait; }
.shop-chat-attach-icon { font-size: 1.15rem; line-height: 1; }
.shop-chat-attach-label {
  font-size: .62rem;
  letter-spacing: .01em;
  font-weight: 600;
  white-space: nowrap;
}
.shop-chat-pending {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 0 1rem .4rem;
}
.shop-chat-filechip {
  display: flex;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  padding: .25rem .4rem .25rem .3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: .78rem;
}
.shop-chat-filechip img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
}
.shop-chat-file-ext {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef3ff;
  color: #007AFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .55rem;
  font-weight: 700;
}
.shop-chat-file-name {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-chat-filechip button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f4;
  color: #333;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.shop-chat-file-err {
  margin: 0 1rem .35rem;
  color: #b42318;
  font-size: .82rem;
}
.shop-chat-hints {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 0 1rem .35rem;
}
.shop-chat-hints button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: .28rem .65rem;
  font-size: .78rem;
  cursor: pointer;
}
.shop-chat-hints button:hover { color: #007AFF; border-color: #007AFF; }
@media (max-width: 800px) {
  .shop-chat-head { padding-left: 3.4rem; }
  .shop-chat-bubble { max-width: 96%; }
}

.home-chat-link {
  margin: .35rem 0 .9rem;
  font-size: .9rem;
}
.home-chat-link a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.home-chat-link a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Chat-first home */
body.home-view.chat-view .composer { display: none; }
body.home-view.chat-view .app {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  justify-content: flex-start;
}
.shop-chat.home-primary .shop-chat-head {
  text-align: center;
  padding-top: 1.35rem;
}
.shop-chat.home-primary .shop-chat-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin: 0 auto .75rem;
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: center;
}
.shop-chat.home-primary .shop-chat-brand span { color: var(--ice, #2B7FFF); }
.shop-chat.home-primary .shop-chat-brand img,
.shop-chat.home-primary .shop-chat-brand .fieldbot-mark {
  width: 190px;
  height: 190px;
  max-width: min(190px, 70vw);
  max-height: min(190px, 70vw);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: center;
}

/* Chat home: five bin bubbles under FieldBot, centered & evenly spaced */
.chat-bin-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.45rem, 2.2vw, 1.15rem);
  flex-wrap: nowrap;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto .65rem;
  padding: 0 .5rem;
  box-sizing: border-box;
}
.chat-bin-row .chat-bin-circle {
  flex: 0 0 auto;
}
.chat-bin-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  width: 5.85rem;
  height: 5.85rem;
  padding: .35rem .28rem .4rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: #FFFFFF;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(5, 5, 5, 0.04), 0 8px 22px rgba(5, 5, 5, 0.05);
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
}
.chat-bin-circle:hover {
  border-color: rgba(5, 5, 5, 0.22);
  box-shadow: 0 2px 4px rgba(5, 5, 5, 0.06), 0 12px 28px rgba(5, 5, 5, 0.08);
  transform: translateY(-2px);
  color: var(--ink);
}
.chat-bin-avatar {
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #F3F4F6;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
}
.chat-bin-avatar svg {
  width: 58%;
  height: 58%;
  display: block;
}
.chat-bin-label {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--ink);
  max-width: 100%;
  padding: 0 .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-bin-num {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.shop-chat.home-primary .home-board-link {
  margin: .55rem 0 0;
  font-size: .78rem;
  color: var(--muted);
}
.shop-chat.home-primary .home-board-link a { color: var(--muted); }
.shop-chat.home-primary .home-board-link a:hover { color: var(--ink); }
@media (max-width: 720px) {
  .chat-bin-circle {
    width: 4.35rem;
    height: 4.35rem;
    gap: .08rem;
    padding: .28rem .2rem .32rem;
  }
  .chat-bin-num { font-size: .9rem; }
  .chat-bin-label { font-size: .48rem; }
  .shop-chat.home-primary .shop-chat-brand { font-size: 1.25rem; letter-spacing: .1em; margin-bottom: .55rem; }
  .chat-bin-row { gap: clamp(.28rem, 1.8vw, .7rem); max-width: 100%; }
}
@media (max-width: 420px) {
  .chat-bin-circle { width: 3.85rem; height: 3.85rem; }
  .chat-bin-label { font-size: .44rem; }
}


.shop-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .55rem;
}
.shop-chat-links a,
.shop-chat-links button.doc-link {
  display: inline-block;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.18);
  color: #fff !important;
  text-decoration: none;
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .82rem;
  cursor: pointer;
  font: inherit;
}
.shop-chat-links a:hover,
.shop-chat-links button.doc-link:hover { background: #050505; }
.shop-chat-bubble a.doc-link,
.shop-chat-bubble button.doc-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.shop-chat-bubble.assistant a.doc-link { color: #007AFF; text-decoration: underline; }
.shop-chat-bubble.user a.doc-link { color: #fff; text-decoration: underline; }
.shop-chat-bubble.assistant .shop-chat-links a {
  background: #007AFF;
  border-color: #007AFF;
  color: #fff !important;
}
.shop-chat-bubble.user .shop-chat-links a {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.4);
}

.sidebar-nav a.nav-chat.on,
.sidebar-nav a[data-nav="/"].on { font-weight: 600; }
.home-board-link {
  margin: .35rem 0 0;
  font-size: .8rem;
}
.home-board-link a { color: var(--faint); text-decoration: none; }
.home-board-link a:hover { color: var(--ink); }


/* Live search typeahead over composer */
.composer { position: relative; }
.search-live {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + .45rem);
  max-height: min(58vh, 22rem);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 10px 32px rgba(5,5,5,.12);
  z-index: 40;
  padding: .35rem;
}
.search-live-row,
.search-live-more {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  grid-template-rows: auto auto;
  column-gap: .55rem;
  row-gap: .08rem;
  padding: .55rem .65rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
}
.search-live-row:hover,
.search-live-more:hover { background: #f3f4f6; }
.search-live-kind {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #007AFF;
}
.search-live-name {
  font-weight: 600;
  font-size: .95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-live-sub {
  grid-column: 2;
  color: var(--muted);
  font-size: .78rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-live-more {
  display: block;
  text-align: center;
  color: #007AFF;
  font-weight: 600;
  font-size: .88rem;
  margin-top: .15rem;
}
.search-live-empty {
  padding: .85rem 1rem;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}
body.chat-view #topSearch .search-live,
body.home-view #topSearch .search-live { display: none !important; }
#deskSearch { position: relative; }
#deskSearch .search-live {
  bottom: auto;
  top: calc(100% + 0.45rem);
  z-index: 80;
}


/* —— Billing success intake confirmation (shop number) —— */
.billing-intake-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem 1rem;
  flex: 0 0 auto;
  padding: .85rem 1rem;
  background: rgba(158, 216, 234, 0.12);
  border-bottom: 1px solid rgba(158, 216, 234, 0.35);
  color: #e5e7eb;
  font-size: .92rem;
  line-height: 1.4;
  z-index: 6;
}
.billing-intake-banner[hidden] { display: none !important; }
.billing-intake-banner .intake-copy { flex: 1 1 16rem; min-width: 0; }
.billing-intake-banner .intake-copy strong { color: #f9fafb; font-weight: 650; }
.billing-intake-banner .intake-num {
  font-variant-numeric: tabular-nums;
  color: #9ed8ea;
  font-weight: 700;
  font-size: 1.05em;
}
.billing-intake-banner .intake-note {
  display: block;
  margin-top: .25rem;
  color: #9ca3af;
  font-size: .82rem;
}
.billing-intake-banner .intake-dismiss {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid rgba(158, 216, 234, 0.35);
  color: #9ed8ea;
  border-radius: 8px;
  padding: .35rem .7rem;
  cursor: pointer;
  font-size: .8rem;
}
.billing-intake-banner .intake-dismiss:hover {
  background: rgba(158, 216, 234, 0.12);
}
body.has-intake-banner.home-view .grok-hero { padding-top: .35rem; }

/* —— Guided setup ride coach —— */
.setup-coach {
  position: fixed;
  z-index: 9200;
  right: 1rem;
  bottom: 1rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}
.setup-coach-card {
  pointer-events: auto;
  padding: 1rem 1.05rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(158, 216, 234, 0.28);
  background: rgba(12, 16, 22, 0.96);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  color: #e8edf2;
}
.setup-kicker {
  margin: 0 0 0.35rem;
  color: #8b95a3;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.setup-coach-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.setup-body { margin: 0 0 0.65rem; color: #c7cdd6; font-size: 0.9rem; line-height: 1.4; }
.setup-prompt {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(158, 216, 234, 0.08);
  border: 1px solid rgba(158, 216, 234, 0.16);
  font-size: 0.82rem;
  line-height: 1.35;
  color: #d5dce4;
  word-break: break-word;
}
.setup-prompt code { font: inherit; color: #9ed8ea; }
.setup-actions { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
.setup-form .field { margin-bottom: 0.75rem; }
.setup-form-card .welcome-actions { margin-top: 0.5rem; }
body.setup-active.chat-view .setup-coach { bottom: 5.5rem; }
@media (max-width: 800px) {
  /* setup-coach-wide: most of the screen on small phones; never a skinny left column */
  .setup-coach,
  .setup-coach.setup-coach-wide {
    left: 0.75rem;
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
    max-width: none;
    box-sizing: border-box;
    bottom: 0.75rem;
  }
  body.setup-active.chat-view .setup-coach { bottom: 5.25rem; }
}


/* —— Document workspace (estimates / invoices) —— */
.doc-ws {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.doc-ws[hidden] { display: none !important; }
.doc-ws-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, .35);
  pointer-events: auto;
}
.doc-ws-panel {
  position: relative;
  pointer-events: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  width: min(520px, 100%);
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 48px rgba(5, 5, 5, .12);
}
.doc-ws-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.1rem .7rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.doc-ws-head h1 {
  font-size: 1.05rem;
  margin: 0 0 .35rem;
  line-height: 1.25;
}
.doc-ws-badge {
  display: inline-block;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg-2);
}
.doc-ws-badge.draft { color: #0B1F3A; border-color: rgba(11, 31, 58, 0.18); background: var(--bg); }
.doc-ws-badge.sent { color: #1a5c38; border-color: #b7dcc7; background: #eaf6ef; }
.doc-ws-badge.paid { color: #1a5c38; border-color: #b7dcc7; background: #eaf6ef; }
.doc-ws-badge.voided { color: #8a2f2f; border-color: #e0b4b4; background: #f8ecec; }
.doc-ws-body {
  flex: 1;
  overflow: auto;
  padding: .9rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.doc-ws-fields .field { margin-bottom: .7rem; }
.doc-ws-fields input,
.doc-ws-fields textarea {
  font-size: 1rem;
  min-height: 48px;
}
.doc-ws-fields textarea { min-height: 110px; }
.doc-ws-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  min-height: 220px;
  flex: 1;
}
.doc-ws-preview iframe {
  width: 100%;
  height: min(52vh, 520px);
  border: 0;
  background: #fff;
}
.doc-ws-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .85rem 1.1rem calc(.95rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
}
.doc-ws-actions .btn {
  min-height: 48px;
  flex: 1 1 auto;
  font-size: 1rem;
}
.doc-ws-actions .btn-primary { flex: 1 1 100%; }
.doc-ws-note {
  font-size: .9rem;
  color: var(--muted);
  margin: 0;
}
.doc-ws-status {
  font-size: .85rem;
  color: var(--muted);
  min-height: 1.2em;
}
.doc-ws-status.err { color: var(--bad); }
.doc-ws-status.ok { color: #1a5c38; }
.doc-row-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: .55rem 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.doc-row-open:hover .doc-row-label { text-decoration: underline; }
.doc-money-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .55rem 0 .85rem;
}
.doc-money-actions .btn { min-height: 44px; }

@media (max-width: 800px) {
  .doc-ws {
    align-items: stretch;
  }
  .doc-ws-panel {
    width: 100%;
    border-left: 0;
    border-radius: 16px 16px 0 0;
    margin-top: 8vh;
    height: 92dvh;
    max-height: 92dvh;
  }
  .doc-ws-preview iframe {
    height: min(42vh, 360px);
  }
}


/* Document pops inside chat — compact bubble, chat stays readable */
.doc-ws-chat {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  width: auto;
  max-width: min(82%, 36rem);
  margin: .15rem 0 .5rem;
  margin-left: 0;
  margin-right: auto;
  pointer-events: auto;
  animation: docWsIn .25s ease-out;
  box-sizing: border-box;
}
.doc-ws-chat[hidden] { display: none !important; }
@keyframes docWsIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.doc-ws-chat-card {
  background: #0A0A0A;
  border: 0;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  box-shadow: none;
  overflow: hidden;
  width: 100%;
}
.doc-ws-chat-kicker {
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #666;
  padding: .55rem .85rem 0;
}
.doc-ws-chat .doc-ws-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .85rem .5rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.doc-ws-chat .doc-ws-head h1 {
  font-size: .95rem;
  margin: 0 0 .25rem;
  line-height: 1.25;
}
.doc-ws-chat .doc-ws-body {
  padding: .55rem .85rem .35rem;
  max-height: none;
  overflow: visible;
}
.doc-ws-chat .doc-ws-fields .field { margin-bottom: .45rem; }
.doc-ws-chat .doc-ws-fields input,
.doc-ws-chat .doc-ws-fields textarea {
  font-size: .9rem;
  background: #fff;
  border-radius: 10px;
}
.doc-ws-chat .doc-ws-fields textarea { min-height: 64px; max-height: 110px; }
.doc-ws-chat .doc-ws-note {
  font-size: .78rem;
  margin: .15rem 0 .4rem;
  color: #555;
}
.doc-ws-chat .doc-ws-preview {
  display: none; /* collapsed by default — expand with Show preview */
  min-height: 0;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  overflow: hidden;
  background: #fff;
  margin-top: .35rem;
}
.doc-ws-chat.is-expanded .doc-ws-preview { display: block; }
.doc-ws-chat .doc-ws-preview iframe {
  width: 100%;
  height: 180px;
  border: 0;
  background: #fff;
}
.doc-ws-chat .doc-ws-actions {
  display: flex;
  flex-wrap: wrap;
  padding: .55rem .85rem .75rem;
  gap: .4rem;
  border-top: 1px solid rgba(0,0,0,.06);
  background: transparent;
}
.doc-ws-chat .doc-ws-actions .btn {
  flex: 0 1 auto;
  font-size: .85rem;
  padding: .45rem .7rem;
}
.doc-ws-chat .doc-ws-actions .btn-primary {
  flex: 1 1 auto;
}
.doc-ws-chat .doc-ws-status {
  font-size: .78rem;
  padding: 0 .85rem .35rem;
}
/* Kill any leftover full-bleed dock */
body.desk-doc-open .doc-ws { display: none !important; }
@media (max-width: 720px) {
  .doc-ws-chat { max-width: 94%; }
  .doc-ws-chat .doc-ws-preview iframe { height: 150px; }
}

.shop-chat-log > .doc-ws-chat {
  align-self: flex-start;
  max-width: min(82%, 36rem);
}

/* Live draft in the main workspace — letterhead, no type-in fields */
.doc-ws-main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 2rem);
  height: 100%;
}
.doc-ws-main[hidden] { display: none !important; }
.doc-ws-main-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.doc-ws-main .doc-ws-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1.1rem .7rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.doc-ws-main .doc-ws-head h1 { font-size: 1.05rem; margin: 0 0 .3rem; }
.doc-ws-main .doc-ws-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: .85rem 1.1rem;
  display: flex;
  flex-direction: column;
}
.doc-ws-main .doc-ws-preview {
  display: block !important;
  flex: 1;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.doc-ws-main .doc-ws-preview iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: #fff;
}
.doc-ws-main .doc-ws-fields,
.doc-ws-main input,
.doc-ws-main textarea { display: none !important; }
.doc-ws-main .doc-ws-facts { padding: .4rem 0 1rem; }
.doc-ws-main .doc-ws-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .75rem 1.1rem;
  border-top: 1px solid var(--line);
}
.doc-ws-main .doc-ws-actions .btn { min-height: 44px; }

.setup-chip-list {
  margin: .6rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted, #8a8a8a);
  font-size: .92rem;
  line-height: 1.45;
}
.setup-chip-list li { margin: .15rem 0; }
.welcome-card-wide { width: min(560px, 100%); }
.setup-unlock {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 1.15rem;
}
.setup-unlock-card {
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(158, 216, 234, 0.18);
  background: rgba(158, 216, 234, 0.06);
}
.setup-unlock-card strong {
  display: block;
  color: #f3f4f6;
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}
.setup-unlock-card span {
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1.35;
}
.setup-nav-list {
  margin: 0.45rem 0 0.75rem;
  padding: 0;
  list-style: none;
  color: #c7cdd6;
  font-size: 0.8rem;
  line-height: 1.4;
  max-height: 12rem;
  overflow: auto;
}
.setup-nav-list li { margin: 0.2rem 0; }
.setup-nav-list strong { color: #f3f4f6; }
.setup-phone-num {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 1.35rem;
  font-weight: 650;
  color: #f3f4f6;
}
.setup-coach-card .setup-phone-num {
  display: block;
  width: 100%;
  margin: 0 0 0.55rem;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}
@media (max-width: 800px) {
  .setup-unlock { grid-template-columns: 1fr; }
}

/* —— FieldBot HQ (staff monitor, dark) —— */
.hq-body {
  --hq-bg: #0B1F3A;
  --hq-panel: #102848;
  --hq-ink: #F8FAFC;
  --hq-muted: #94A3B8;
  --hq-line: rgba(43, 127, 255, 0.22);
  --hq-accent: #2B7FFF;
  min-height: 100vh;
  margin: 0;
  background: var(--hq-bg);
  color: var(--hq-ink);
}
.hq-body .brand { color: var(--hq-ink); }
.hq-body .brand span,
.hq-body .fieldbot-word { color: var(--hq-ink); }
.hq-body .brand img,
.hq-body .fieldbot-mark {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.hq-login-body {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(1.4rem, env(safe-area-inset-top, 0px)) 1.2rem 2rem;
  background: #050608;
}
.hq-body .hq-card {
  background: var(--hq-panel);
  border: 1px solid var(--hq-line);
  box-shadow: none;
  text-align: center;
  color: var(--hq-ink);
}
.hq-body .login-kicker { color: var(--hq-ink); }
.hq-body .login-hint { color: var(--hq-muted); }
.hq-body .login-form label { color: var(--hq-muted); }
.hq-body .login-form input {
  background: #080a0e;
  border-color: var(--hq-line);
  color: var(--hq-ink);
}
.hq-body .login-form input:focus {
  border-color: var(--hq-accent);
  box-shadow: 0 0 0 1px rgba(158, 216, 234, 0.25);
}
.hq-body .btn-primary {
  background: #2B7FFF;
  border-color: #2B7FFF;
  color: #fff;
}
.hq-body .btn-primary:hover {
  background: #061428;
  border-color: #061428;
  color: #fff;
}
.hq-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem 0.4rem;
  max-width: 920px;
  margin: 0 auto;
}
.hq-kicker {
  margin: .2rem 0 0;
  color: var(--hq-muted);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hq-top-right {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.hq-unread {
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #050608;
  background: var(--hq-accent);
  border-radius: 999px;
  padding: .25rem .65rem;
  font-weight: 600;
}
.hq-signout {
  min-height: 36px;
  padding: .35rem .9rem;
  color: var(--hq-muted);
  border-color: var(--hq-line);
  background: transparent;
}
.hq-signout:hover { color: var(--hq-ink); border-color: var(--hq-ink); }
.hq-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0.6rem 1.4rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}
.hq-section-head h1 {
  margin: 0 0 .2rem;
  font-size: 1.2rem;
  color: var(--hq-ink);
  text-transform: none;
  letter-spacing: -0.02em;
}
.hq-sub {
  margin: 0 0 .85rem;
  color: var(--hq-muted);
  font-size: .9rem;
}
.hq-list { display: flex; flex-direction: column; gap: .45rem; }
.hq-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--hq-panel);
  border: 1px solid var(--hq-line);
  border-radius: 14px;
}
.hq-row-title {
  font-weight: 600;
  letter-spacing: -0.015em;
}
.hq-row-meta {
  margin-top: .15rem;
  color: var(--hq-muted);
  font-size: .88rem;
}
.hq-snip {
  margin-top: .4rem;
  color: var(--hq-ink);
  font-size: .95rem;
  line-height: 1.4;
}
.hq-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
  flex: 0 0 auto;
}
.hq-time { color: var(--hq-muted); font-size: .78rem; white-space: nowrap; }
.hq-pill {
  display: inline-block;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--hq-line);
  color: var(--hq-muted);
}
.hq-pill-paid { color: #7dcea0; border-color: rgba(125, 206, 160, 0.35); }
.hq-pill-trial { color: var(--hq-accent); border-color: rgba(158, 216, 234, 0.35); }
.hq-pill-kind { margin-left: .4rem; vertical-align: 1px; }
.hq-empty { color: var(--hq-muted); padding: .6rem 0; }
@media (max-width: 640px) {
  .hq-row { flex-direction: column; }
  .hq-row-side { align-items: flex-start; }
}

/* HQ tabs + conversations + chat */
.hq-phone {
  margin: .35rem 0 0;
  color: var(--hq-accent);
  font-size: .95rem;
  letter-spacing: .02em;
}
.hq-tabs {
  display: flex;
  gap: .35rem;
  max-width: 920px;
  margin: .4rem auto 0;
  padding: 0 1.4rem;
}
.hq-tab {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hq-line);
  color: var(--hq-muted);
  border-radius: 999px;
  padding: .4rem .95rem;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}
.hq-tab.is-on {
  color: #050608;
  background: var(--hq-accent);
  border-color: var(--hq-accent);
}
.hq-pane[hidden] { display: none !important; }
.hq-pane.is-on { display: flex; flex-direction: column; gap: 1.8rem; }
.hq-imessage {
  gap: 0 !important;
  min-height: 70vh;
}
.hq-imessage.is-thread .hq-im-list { display: none; }
.hq-im-rows { display: flex; flex-direction: column; gap: .35rem; }
.hq-im-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  text-align: left;
  background: var(--hq-panel);
  border: 1px solid var(--hq-line);
  border-radius: 16px;
  padding: .7rem .85rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.hq-im-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1b2430;
  color: var(--hq-accent);
  font-weight: 700;
}
.hq-im-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.hq-im-title { font-weight: 600; }
.hq-im-snip { color: var(--hq-muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hq-im-thread {
  display: flex;
  flex-direction: column;
  min-height: 70vh;
  background: var(--hq-panel);
  border: 1px solid var(--hq-line);
  border-radius: 18px;
  overflow: hidden;
}
.hq-im-thread-top {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--hq-line);
}
.hq-im-back {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--hq-accent);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .2rem;
}
.hq-im-who { font-weight: 650; }
.hq-im-sub { color: var(--hq-muted); font-size: .8rem; }
.hq-im-msgs {
  flex: 1;
  overflow: auto;
  padding: 1rem .9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.hq-bubble {
  max-width: min(78%, 34rem);
  padding: .55rem .8rem .4rem;
  border-radius: 16px;
  line-height: 1.4;
}
.hq-bubble.is-in {
  align-self: flex-start;
  background: #1c222b;
  border-bottom-left-radius: 6px;
}
.hq-bubble.is-out {
  align-self: flex-end;
  background: #2f6fed;
  color: #fff;
  border-bottom-right-radius: 6px;
}
.hq-bubble-meta {
  margin-top: .2rem;
  font-size: .7rem;
  opacity: .7;
}
.hq-im-rec { margin-top: .3rem; font-size: .85rem; }
.hq-im-rec a { color: inherit; }
.hq-im-compose, .hq-chat-compose {
  display: flex;
  gap: .5rem;
  padding: .7rem;
  border-top: 1px solid var(--hq-line);
}
.hq-im-compose textarea,
.hq-chat-compose textarea {
  flex: 1;
  resize: none;
  border-radius: 14px;
  border: 1px solid var(--hq-line);
  background: #080a0e;
  color: var(--hq-ink);
  padding: .55rem .75rem;
  font: inherit;
}
.hq-im-send {
  appearance: none;
  border: 0;
  background: #2f6fed;
  color: #fff;
  border-radius: 999px;
  padding: .45rem .95rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.hq-chat-pane { gap: .8rem !important; min-height: 70vh; }
.hq-chat-log {
  flex: 1;
  min-height: 48vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .4rem 0 1rem;
}
@media (max-width: 640px) {
  .hq-tabs { padding: 0 1rem; }
}

/* HQ desk shell — same layout as shop, staff nav */
.hq-desk .nav-chat::before { content: ""; }
.hq-desk [data-nav="/hq/trials"]::before,
.hq-desk [data-nav="/hq/subscribers"]::before { content: ""; }
body.sidebar-collapsed #trialCount,
body.sidebar-collapsed #subCount { display: none; }
.hq-desk #hqPhoneFoot,
.hq-desk #hqEmailFoot {
  display: block;
  padding: .35rem .7rem;
  color: var(--sidebar-muted, var(--muted));
  font-size: .82rem;
  cursor: pointer;
  user-select: all;
}
.hq-desk #hqEmailFoot { word-break: break-all; }
.hq-desk .hq-copy { cursor: pointer; user-select: all; }

.hq-desk [data-nav="/hq/economics"]::before { content: ""; }

.econ-wrap { max-width: 880px; margin: 0 auto; padding-bottom: 2rem; }
.econ-wrap .page-head { align-items: flex-end; }
.econ-month {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
}
.econ-month select {
  min-width: 11.5rem;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.econ-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 0 0 1.15rem;
}
.econ-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .95rem 1rem;
}
.econ-card span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
}
.econ-card b {
  display: block;
  margin-top: .35rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}
.econ-card em {
  display: block;
  margin-top: .2rem;
  font-style: normal;
  color: var(--muted);
  font-size: .78rem;
}
.econ-margin b { color: var(--electric); font-size: 1.7rem; }
.econ-margin.is-warn b { color: var(--warn); }
.econ-warn {
  background: #FFF8E8;
  border: 1px solid rgba(166, 124, 0, 0.28);
  color: #6B5200;
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin: 0 0 1.15rem;
  font-size: .92rem;
}
.econ-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.15rem;
  margin: 0 0 .85rem;
}
.econ-section h2 {
  margin: 0 0 .75rem;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.econ-ledger { display: flex; flex-direction: column; gap: .45rem; }
.econ-ledger > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
}
.econ-ledger b { font-variant-numeric: tabular-nums; font-weight: 600; }
.econ-ledger .econ-total {
  margin-top: .25rem;
  padding-top: .55rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.econ-note, .econ-shops {
  margin: .7rem 0 0;
  color: var(--muted);
  font-size: .85rem;
}
.econ-costs { display: flex; flex-direction: column; gap: .45rem; }
.econ-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.econ-cost-row span { color: var(--ink); }
.econ-cost-row input {
  width: 7.5rem;
  text-align: right;
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-variant-numeric: tabular-nums;
}
.econ-cost-row input:focus {
  outline: none;
  border-color: var(--electric);
  box-shadow: 0 0 0 3px var(--glow);
}
.econ-save-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .55rem;
}
.econ-saved { color: var(--ok); font-size: .85rem; }
.econ-rule ul {
  margin: 0 0 .85rem;
  padding-left: 1.15rem;
  color: var(--ink);
}
.econ-rule li { margin: .3rem 0; }
.econ-target {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--muted);
  font-size: .85rem;
}
.econ-target input {
  width: 5rem;
  padding: .35rem .5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: right;
}
@media (max-width: 900px) {
  .econ-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .econ-card.econ-margin { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .econ-cards { grid-template-columns: 1fr; }
  .econ-card.econ-margin { grid-column: auto; }
  .econ-cost-row { flex-direction: column; align-items: stretch; }
  .econ-cost-row input { width: 100%; text-align: left; }
}

/* —— Chat-first shop desk: page never scrolls —— */
html.desk-ready,
html:has(body.desk-shell),
body.desk-shell {
  width: 100%;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  height: var(--desk-vh, 100dvh);
  max-width: 100%;
  max-height: 100%;
  max-height: 100svh;
  max-height: 100dvh;
  max-height: var(--desk-vh, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
}
body.desk-shell {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
}
body.desk-shell .shell {
  flex-direction: row;
  width: 100%;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  height: var(--desk-vh, 100dvh);
  max-height: 100%;
  max-height: 100svh;
  max-height: 100dvh;
  max-height: var(--desk-vh, 100dvh);
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body.desk-shell .sidebar {
  display: flex;
  width: 208px;
  flex: 0 0 208px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
body.desk-shell .sidebar .fieldbot-mark,
body.desk-shell .sidebar .brand img {
  width: 96px;
  height: auto;
  max-width: 160px;
  object-fit: contain;
}
body.desk-shell .sidebar-nav {
  flex: 1 1 auto;
  overflow: auto;
}
body.desk-shell .sidebar-foot .nav-urgent {
  color: #fff;
  font-size: .82rem;
  font-weight: 650;
}
body.desk-shell .sidebar-help {
  color: #94A3B8;
  border-color: rgba(148, 163, 184, 0.28);
  font-size: .68rem;
}
body.desk-shell .sidebar-foot {
  padding-bottom: 0;
}
.desk-col {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.desk-shell .trial-banner,
body.desk-shell .billing-intake-banner {
  flex: 0 0 auto;
}
.topbar {
  display: flex;
  align-items: center;
  gap: .75rem 1rem;
  flex: 0 0 auto;
  min-height: 58px;
  padding: .35rem .85rem .35rem .55rem;
  background: #000000;
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 40;
}
.topbar-brand { flex: 0 0 auto; color: #fff; }
.topbar-brand:hover { color: #fff; }
.topbar .fieldbot-mark-sm {
  width: 48px;
  height: auto;
  max-width: 120px;
  object-fit: contain;
}
.topnav {
  display: flex;
  align-items: center;
  gap: .15rem;
  flex: 1 1 auto;
  min-width: 0;
}
.topnav a {
  color: #FFFFFF;
  font-weight: 650;
  font-size: .95rem;
  letter-spacing: -0.01em;
  padding: .45rem .85rem;
  border-radius: 10px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.topnav a:hover { background: rgba(43, 127, 255, 0.16); color: #fff; }
.topnav a.on { background: rgba(43, 127, 255, 0.28); color: #fff; }
.topbar-end {
  display: flex;
  align-items: center;
  gap: .45rem .65rem;
  flex: 0 0 auto;
  margin-left: auto;
}
.topbar-shop {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #E2E8F0;
  max-width: 10rem;
  min-width: 0;
}
.topbar-shop .shop-mark {
  color: #E2E8F0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-shop .shop-logo { width: 22px; height: 22px; border-radius: 4px; }
.topbar-urgent {
  color: #fff;
  font-size: .82rem;
  font-weight: 650;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: rgba(43, 127, 255, 0.22);
  white-space: nowrap;
}
.topbar-urgent #urgentCount {
  display: inline-block;
  min-width: 1.1em;
  margin-left: .15rem;
}
.topbar-logout { color: #94A3B8; font-size: .82rem; }
.topbar-logout:hover { color: #fff; }

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
/* Conversations is inbox/thread only. Shop Chat opens from the widget. */
body.desk-shell.conv-view .desk,
body.desk-shell.conv-view.live-split .desk {
  display: block !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
body.desk-shell.conv-view .mainpane {
  height: 100%;
  max-height: 100%;
}
body.desk-shell.conv-view #chatPane,
body.desk-shell.conv-view .chatpane,
body.desk-shell.conv-view #rightDockRail,
body.desk-shell.conv-view .live-chat-rail,
body.desk-shell.conv-view .shop-chat,
body.desk-shell.conv-view #shopChatForm {
  display: none !important;
}
body.desk-shell.conv-view .imsg-one,
body.desk-shell.conv-view .imsg-thread-only {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  width: 100%;
}
body.desk-shell.conv-view .thread-wrap .imsg-list-col,
body.desk-shell.conv-view .imsg-one .imsg-list-col { display: none !important; }
body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileDesk,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileTalkDock {
  display: none !important;
}
.mainpane {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  background: var(--bg);
}
.owner-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 84px;
  height: 84px;
  padding: 6px 16px;
  margin: 0;
  background: #000000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
}
.owner-sticky-brand,
.owner-sticky-brand:hover {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
  color: #FFFFFF;
}
.owner-sticky-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: var(--chat-sliver, 108px);
  max-width: min(280px, 70vw);
  object-fit: contain;
  object-position: left center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.owner-sticky .mobile-menu {
  display: none;
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  margin-left: auto;
  flex: 0 0 auto;
  z-index: 21;
  background: transparent;
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.28);
}
.mainpane-body {
  padding: 1.15rem 1.25rem 2rem;
}
.live-chat-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 6px 3px;
  background: #0B1F3A;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(43, 127, 255, 0.28), 8px 0 24px rgba(0, 0, 0, 0.22);
}
.live-chat-rail-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: transparent;
}
.chatpane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  background: #0B1F3A;
  color: #E2E8F0;
  border-left: 0;
  box-shadow: inset 3px 0 0 #2B7FFF, -14px 0 28px rgba(0, 0, 0, 0.22);
}
.chatpane .shop-chat {
  max-width: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #0B1F3A;
  color: #E2E8F0;
}
.chatpane .shop-chat-head {
  background: #071628;
  border-bottom: 1px solid rgba(43, 127, 255, 0.35);
  color: #FFFFFF;
}
.chatpane .shop-chat-head h1 { color: #FFFFFF; }
.chatpane .shop-chat-head .sub { color: #94A3B8; }
.chatpane .shop-chat-log { background: #0B1F3A; }
.chatpane .shop-chat-bubble.assistant {
  background: #16325A;
  color: #E2E8F0;
}
.chatpane .shop-chat-bubble.user {
  background: #2B7FFF;
  color: #FFFFFF;
}
.chatpane .shop-chat-bubble.system { color: #94A3B8; }
.chatpane .shop-chat-hints { background: #071628; }
.chatpane .shop-chat-hints button {
  background: transparent;
  border: 1px solid #2B7FFF;
  color: #E2E8F0;
}
.chatpane .shop-chat-hints button:hover {
  color: #FFFFFF;
  border-color: #7CB4FF;
}
.chatpane .shop-chat-form {
  background: #071628;
  border-top: 1px solid rgba(226, 232, 240, 0.16);
  padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
}
.chatpane .shop-chat-form textarea {
  background: #0A1930;
  color: #FFFFFF;
  border-color: rgba(226, 232, 240, 0.22);
}
.chatpane .shop-chat-form textarea::placeholder { color: #94A3B8; }
.chatpane .shop-chat-form textarea:focus {
  border-color: #2B7FFF;
  background: #0A1930;
  color: #FFFFFF;
}
.chatpane .shop-chat-attach {
  background: transparent;
  border-color: #2B7FFF;
  color: #7CB4FF;
}
.chatpane .shop-chat-attach:hover {
  background: rgba(43, 127, 255, 0.12);
  border-color: #7CB4FF;
}
.chatpane .shop-chat-filechip {
  background: #16325A;
  color: #E2E8F0;
  border-color: rgba(226, 232, 240, 0.16);
}
.chatpane .shop-chat-status { color: #94A3B8; }
.chatpane .shop-chat-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-align: left;
  padding: .7rem .9rem .6rem;
}
.chatpane .shop-chat-avatar {
  width: 36px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  flex: 0 0 auto;
  background: transparent;
}
.chatpane .shop-chat-head h1 {
  font-size: 1rem;
  margin: 0;
}
.chatpane .shop-chat-head .sub { margin: .1rem 0 0; }
.chatpane .shop-chat-form textarea { min-height: 52px; }
.shop-chat-hintline {
  margin: 0;
  padding: 0 .95rem .7rem;
  color: var(--muted);
  font-size: .78rem;
}
.chat-close {
  display: none;
  margin-left: auto;
  border: 0;
  background: #F1F5F9;
  color: #0B1F3A;
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  padding: .35rem .7rem;
  border-radius: 999px;
  cursor: pointer;
}
.chat-fab, .chat-backdrop { display: none; }
.chat-fab img {
  display: block;
  width: auto;
  height: auto;
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: transparent;
}
.sidebar-backdrop { display: none; }

body.desk-shell .composer,
body.desk-shell #topSearch { display: none !important; }

/* Board */
.board-wrap { max-width: 820px; }
.board-lead {
  margin: 0 0 1.1rem;
}
.board-lead h1 { margin: 0 0 .25rem; font-size: 1.45rem; }
.board-lead p { margin: 0; color: var(--muted); font-size: .95rem; }
.board-stages {
  display: grid;
  gap: .55rem;
  margin: 0 0 1.15rem;
}
.board-stage {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
}
.board-stage:hover { border-color: #2B7FFF; color: var(--ink); }
.board-stage-label { font-weight: 650; flex: 1 1 auto; }
.board-stage-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0B1F3A;
}
.board-stage-dollars { color: var(--muted); font-size: .85rem; }
.board-more {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .85rem;
  color: var(--muted);
  font-size: .88rem;
}
.board-more a { color: #2B7FFF; font-weight: 600; }
.board-urgent {
  margin: 0 0 1rem;
  padding: .75rem .95rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.board-urgent a { color: #2B7FFF; font-weight: 650; }

/* Money */
.money-page { max-width: 860px; }
.money-snap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin: 0 0 1.15rem;
}
.money-snap a, .money-snap div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem .95rem;
  color: inherit;
}
.money-snap b {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.money-snap span { color: var(--muted); font-size: .8rem; font-weight: 650; }
.money-snap .pl-pos b { color: #1a7a4a; }
.money-snap .pl-neg b { color: #e24a40; }
.money-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem 1rem 1rem;
  margin: 0 0 .85rem;
}
.money-block h2 {
  margin: 0 0 .65rem;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.exp-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .45rem 0;
  border-top: 1px solid var(--line);
}
.exp-row:first-of-type { border-top: 0; }
.exp-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #F1F5F9;
  flex: 0 0 auto;
}
.exp-thumb.ph { display: grid; place-items: center; color: var(--muted); font-size: .68rem; }
.receipt-upload { margin: .35rem 0 0; }

/* Packet job file */
.jobfile { max-width: 860px; }
.jobfile-head {
  position: sticky;
  top: 44px;
  z-index: 4;
  background: var(--bg);
  padding: .35rem 0 .75rem;
  margin: 0 0 .75rem;
  border-bottom: 1px solid var(--line);
}
.jobfile-head h1 { margin: 0 0 .15rem; }
.jobfile-phone { color: var(--muted); font-size: .95rem; }
.jobfile-status {
  display: inline-flex;
  margin: .4rem 0 .55rem;
  padding: .18rem .6rem;
  border-radius: 999px;
  background: rgba(43, 127, 255, 0.12);
  color: #0B1F3A;
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.jobfile-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.jobfile-actions .btn { min-height: 38px; }
.jobfile-next { margin: .45rem 0 0; color: var(--muted); font-size: .88rem; }
.job-snap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin: 0 0 1rem;
}
.job-snap div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .65rem .7rem;
}
.job-snap b {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 1.02rem;
}
.job-snap span { color: var(--muted); font-size: .7rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.job-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem 1rem 1rem;
  margin: 0 0 .7rem;
}
.job-card h2 {
  margin: 0 0 .55rem;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.job-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem .85rem;
}
.job-facts div { min-width: 0; }
.job-facts b {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.receipt-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem;
  background: var(--bg);
}
.receipt-card img {
  max-width: 160px;
  max-height: 140px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 980px) {
  .job-snap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .money-snap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  html, body.desk-shell {
    width: 100%;
    height: 100%;
    height: 100svh;
    height: 100dvh;
    height: var(--desk-vh, 100dvh);
    max-height: 100%;
    max-height: 100svh;
    max-height: 100dvh;
    max-height: var(--desk-vh, 100dvh);
    overflow: hidden;
    overscroll-behavior: none;
  }
  body.desk-shell {
    background: var(--bg);
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body.desk-shell .shell {
    width: 100%;
    height: 100%;
    height: 100svh;
    height: 100dvh;
    height: var(--desk-vh, 100dvh);
    max-height: 100%;
    max-height: 100svh;
    max-height: 100dvh;
    max-height: var(--desk-vh, 100dvh);
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
    flex-direction: row;
  }
  body.desk-shell .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    width: 252px;
    flex-basis: 252px;
    height: auto;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  body.desk-shell .sidebar,
  body.desk-shell.sidebar-open .sidebar {
    width: 252px;
    max-width: min(252px, 84vw);
    right: auto;
    flex: 0 0 252px;
  }
  body.desk-shell.sidebar-open .sidebar { transform: translateX(0); box-shadow: 8px 0 32px rgba(11, 31, 58, 0.22); }
  body.desk-shell .sidebar-backdrop,
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 35;
    border: 0;
  }
  body.desk-shell .sidebar-backdrop:not([hidden]),
  .sidebar-backdrop:not([hidden]) {
    display: block;
  }
  body.desk-shell.sidebar-open,
  body.desk-shell.sidebar-open .mainpane,
  body.desk-shell.sidebar-open .desk-col {
    background: var(--bg);
  }
  body.desk-shell.sidebar-open .chatpane {
    background: #0B1F3A;
  }
  body.desk-shell .mobile-menu {
    display: grid;
    width: 44px;
    height: 44px;
    background: #FFFFFF;
    color: #0F172A;
    border: 1px solid #E2E8F0;
    z-index: 45;
  }
  body.desk-shell.sidebar-open .mobile-menu { visibility: hidden; }
  .topbar { flex-wrap: wrap; }
  .topnav { order: 3; flex: 1 1 100%; }
  .topnav a { flex: 1 1 auto; justify-content: center; }
  body.desk-shell .desk-col {
    height: 100%;
    height: 100svh;
    height: 100dvh;
    height: var(--desk-vh, 100dvh);
    max-height: 100%;
    max-height: 100svh;
    max-height: 100dvh;
    max-height: var(--desk-vh, 100dvh);
    min-height: 0;
    overflow: hidden;
  }
  body.desk-shell .desk,
  body.desk-shell.live-split .desk {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 67%) 28px minmax(0, 33%);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    max-width: 100%;
  }
  body.desk-shell.conv-view .desk,
  body.desk-shell.conv-view.live-split .desk {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }
  body.desk-shell.live-collapsed .desk,
  body.desk-shell.live-split.live-collapsed .desk {
    grid-template-rows: minmax(0, 67%) 28px minmax(0, 33%);
  }
  body.desk-shell .live-chat-rail,
  body.desk-shell.live-split .live-chat-rail {
    flex-direction: row;
    width: 100%;
    padding: 2px 10px;
    background: #0B1F3A;
    border-top: 1px solid rgba(226, 232, 240, 0.14);
    border-bottom: 1px solid rgba(43, 127, 255, 0.4);
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.22);
  }
  body.desk-shell .live-chat-rail-logo,
  body.desk-shell.live-split .live-chat-rail-logo {
    width: auto;
    height: auto;
    max-width: min(200px, 78%);
    max-height: 36px;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
  }
  body.desk-shell .mainpane,
  body.desk-shell.live-split .mainpane {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
    background: var(--bg);
    color: #0F172A;
    -webkit-overflow-scrolling: touch;
  }
  body.desk-shell .mainpane-body,
  body.desk-shell.live-split .mainpane-body {
    padding: .85rem .85rem .7rem;
  }
  body.desk-shell .owner-sticky,
  body.desk-shell.live-split .owner-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #000000;
  }
  body.desk-shell .owner-sticky .mobile-menu,
  body.desk-shell.live-split .owner-sticky .mobile-menu {
    display: grid;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    inset: auto;
    z-index: 21;
    background: transparent;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.28);
  }
  body.desk-shell:not(.conv-view) .chatpane,
  body.desk-shell.live-split:not(.conv-view) .chatpane {
    display: flex !important;
    position: relative;
    inset: auto;
    width: auto;
    z-index: 2;
    border: 0;
    border-top: 3px solid #2B7FFF;
    background: #0B1F3A;
    color: #E2E8F0;
    min-height: 0;
    max-width: 100vw;
    overflow: hidden;
    box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.28);
  }
  body.desk-shell .chat-fab,
  body.desk-shell .chat-backdrop,
  body.desk-shell .chat-close,
  body.desk-shell.live-split .chat-fab,
  body.desk-shell.live-split .chat-backdrop,
  body.desk-shell.live-split .chat-close { display: none !important; }
  .job-facts { grid-template-columns: 1fr; }
}

.login-card .shop-logo[hidden],
.login-card .shop-logo[src=""],
.login-card .shop-id-lg[hidden] { display: none; }

/* Login mark hard-cap (EOF): highest-file-order win vs .fieldbot-mark-lg 240px */
body.login-body .fieldbot-mark,
body.login-body .login-card .fieldbot-mark,
body.login-body .login-card .brand img,
body.hq-login-body .fieldbot-mark,
body.hq-login-body .login-card .brand img,
body.hq-login-body .hq-card .fieldbot-mark {
  width: 140px;
  max-width: min(140px, 56vw);
  height: auto;
  object-fit: contain;
}

/* Clients + Crew desk tables */
.desk-page { max-width: 920px; }
.desk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin: 0 0 1rem;
}
.desk-toolbar input[type="search"],
.desk-toolbar input[name="q"] {
  flex: 1 1 220px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem .75rem;
  background: #fff;
}
.desk-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.desk-filters button {
  border: 1px solid var(--line);
  background: #fff;
  color: #0B1F3A;
  border-radius: 999px;
  padding: .28rem .7rem;
  font-size: .8rem;
  font-weight: 650;
  cursor: pointer;
}
.desk-filters button.on {
  background: rgba(43, 127, 255, 0.14);
  border-color: #2B7FFF;
  color: #0B1F3A;
}
.desk-table {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.desk-table table { width: 100%; border-collapse: collapse; }
.desk-table th, .desk-table td {
  text-align: left;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.desk-table th {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: var(--bg);
}
.desk-table tr:last-child td { border-bottom: 0; }
.desk-table tbody tr { cursor: pointer; }
.desk-table tbody tr:hover { background: rgba(43, 127, 255, 0.06); }
.desk-table .name { font-weight: 650; color: #0B1F3A; }
.desk-table .amt { font-variant-numeric: tabular-nums; }
.pill-status {
  display: inline-flex;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #F1F5F9;
  color: #0B1F3A;
}
.pill-status.current, .pill-status.active { background: rgba(43, 127, 255, 0.14); }
.pill-status.missing, .pill-status.past { background: #F1F5F9; color: #64748B; }
.desk-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 1rem; }
.file-onfile { color: var(--muted); font-size: .85rem; }
.file-onfile a { color: #2B7FFF; font-weight: 600; }
.inv-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .4rem 0;
  border-top: 1px solid var(--line);
}
.inv-row:first-child { border-top: 0; }
@media (max-width: 720px) {
  .desk-table { overflow-x: auto; }
  .desk-table table { min-width: 640px; }
}

.addr-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.addr-row:last-child { border-bottom: 0; }
.addr-row .name { font-weight: 600; }
.addr-row .meta { color: var(--muted); font-size: .85rem; }

.live-desk { max-width: none; width: 100%; }
.board-view-toggle { margin: 0; }
.live-quick {
  margin: 0 0 1.1rem;
  padding: 1.05rem 1.1rem 1.15rem;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.live-quick-lead {
  margin: 0 0 .8rem;
  color: #0F172A;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.live-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.live-quick-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .48rem .9rem;
  background: var(--bg);
  color: #0F172A;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  font: inherit;
  font-size: .88rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
}
.live-quick-chip:hover,
.live-quick-chip:focus {
  background: #FFFFFF;
  border-color: #2B7FFF;
  color: #2B7FFF;
  outline: none;
}
.live-feed {
  display: grid;
  gap: 1rem;
  margin-top: .15rem;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-items: start;
}
.live-section {
  margin: 0;
  min-width: 0;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: .95rem 1rem 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.live-section-head { margin: 0 0 .65rem; }
.live-section-title {
  margin: 0;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #64748B;
  font-weight: 650;
}
.live-section-sub {
  margin: .2rem 0 0;
  color: #64748B;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.live-section-list {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.live-row {
  display: flex;
  align-items: flex-start;
  gap: .55rem 1rem;
  margin: 0;
  padding: .8rem .9rem;
  background: var(--bg);
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  color: #0F172A;
  cursor: pointer;
  min-height: 64px;
}
.live-row:hover .name { color: #2B7FFF; }
.live-row-empty { cursor: default; opacity: 0.92; background: var(--bg); }
.live-row-empty:hover .name { color: inherit; }
.live-row-skel .name {
  color: #94A3B8;
}
.live-row-skel {
  position: relative;
  overflow: hidden;
}
.live-row-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(43, 127, 255, 0.08), transparent);
  animation: liveSkel 1.2s ease-in-out infinite;
}
@keyframes liveSkel {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.live-when {
  flex: 0 0 auto;
  color: #64748B;
  font-size: .82rem;
  padding-top: .1rem;
  min-width: 5.5rem;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.live-main { min-width: 0; flex: 1; }
.live-main .name,
.live-main .meta {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.live-main .name { font-weight: 650; color: #0F172A; }
.live-main .meta { color: #64748B; font-size: .88rem; }
.empty-card { min-height: var(--chat-sliver, 108px); display: flex; align-items: center; }
.desk-page { max-width: none; }
@media (max-width: 640px) {
  .live-row { flex-direction: column; gap: .2rem; }
  .live-when { flex: none; }
}



.shop-chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #0B1F3A;
}
.chatpane .shop-chat-thread { background: #0B1F3A; }
.shop-chat-thread .shop-chat-log {
  flex: 1 1 auto;
  min-height: 0;
}
.shop-chat-dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: #071628;
  border-top: 1px solid rgba(43, 127, 255, 0.28);
  box-shadow: 0 -10px 22px rgba(0, 0, 0, 0.22);
}
.chatpane .shop-chat-dock {
  background: #071628;
}
.chatpane .shop-chat {
  background: #0B1F3A;
}
/* —— Mobile Live + Chat 67/33 (page on top, chat dock below) —— */
.shop-chat-status {
  flex: 0 0 auto;
  margin: 0;
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: .01em;
}
.shop-chat-status.working {
  color: #2B7FFF;
  background: rgba(43, 127, 255, 0.10);
}
.shop-chat-status.blocked {
  color: #9a3412;
  background: #ffedd5;
}
.shop-chat-camera,
.shop-chat-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: #007AFF;
  border-radius: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}
.shop-chat-camera:hover,
.shop-chat-mic:hover { border-color: #007AFF; background: #f2f8ff; }
.shop-chat-mic.on { background: #2B7FFF; color: #fff; border-color: #2B7FFF; }
.live-row.on {
  background: rgba(43, 127, 255, 0.10);
  border-radius: 10px;
  box-shadow: inset 3px 0 0 #2B7FFF;
}
.live-split-toggle { display: none; }
.crew-home {
  max-width: 520px;
  padding: .5rem 0 1.5rem;
}
.crew-home h1 { margin: 0 0 .35rem; }
.crew-actions {
  display: grid;
  gap: .65rem;
  margin: 1rem 0;
}
.crew-actions .btn {
  min-height: 48px;
  justify-content: center;
}

@media (max-width: 860px) {
  /* Live stays light. Chat dock is navy. Body/mainpane never go navy. */
  body.desk-shell.live-split,
  body.desk-shell.live-split .mainpane {
    background: var(--bg);
  }
  body.desk-shell.live-split .chatpane,
  body.desk-shell.live-split .chatpane .shop-chat,
  body.desk-shell.live-split .shop-chat-head,
  body.desk-shell.live-split .shop-chat-log,
  body.desk-shell.live-split .shop-chat-thread {
    background: #0B1F3A;
    color: #E2E8F0;
  }
  body.desk-shell.live-split .shop-chat-dock,
  body.desk-shell.live-split .shop-chat-form,
  body.desk-shell.live-split .shop-chat-hints {
    background: #071628;
    color: #E2E8F0;
  }
  body.desk-shell .live-desk,
  body.desk-shell.live-split .live-desk {
    max-width: none;
    color: #0F172A;
  }
  body.desk-shell .live-desk .page-head,
  body.desk-shell.live-split .live-desk .page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin: 0 0 .55rem;
  }
  body.desk-shell .live-desk h1,
  body.desk-shell.live-split .live-desk h1 {
    color: #0F172A;
    margin: 0;
    font-size: 1.2rem;
  }
  body.desk-shell .live-desk .sub,
  body.desk-shell.live-split .live-desk .sub {
    color: #64748B;
    font-size: .82rem;
  }
  .live-quick {
    margin: 0 0 .85rem;
    padding: .85rem .85rem .95rem;
  }
  .live-quick-lead { font-size: .95rem; margin-bottom: .65rem; }
  .live-quick-chip { min-height: 36px; font-size: .82rem; padding: .38rem .75rem; }
  .live-feed { gap: .75rem; grid-template-columns: minmax(0, 1fr); }
  .live-section {
    margin: 0;
    padding: .8rem .8rem .85rem;
  }
  .live-section-title {
    margin: 0;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #64748B;
    font-weight: 650;
  }
  .live-section-list { display: grid; gap: .45rem; grid-template-columns: minmax(0, 1fr); }
  body.desk-shell .live-row,
  body.desk-shell.live-split .live-row {
    min-height: 44px;
    gap: .25rem;
    margin: 0;
    padding: .7rem .75rem;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: var(--bg);
    color: #0F172A;
    flex-direction: column;
    box-shadow: none;
  }
  body.desk-shell .live-row.on,
  body.desk-shell.live-split .live-row.on {
    background: #FFFFFF;
    border-color: #2B7FFF;
    box-shadow: inset 3px 0 0 #2B7FFF;
  }
  body.desk-shell .live-when,
  body.desk-shell.live-split .live-when { color: #64748B; flex: none; }
  body.desk-shell .live-main .name,
  body.desk-shell.live-split .live-main .name { color: #0F172A; }
  body.desk-shell .live-main .meta,
  body.desk-shell.live-split .live-main .meta { color: #64748B; }
  body.desk-shell .board-urgent,
  body.desk-shell.live-split .board-urgent {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
  }
  body.desk-shell .board-urgent a,
  body.desk-shell.live-split .board-urgent a { color: #2B7FFF; }
  body.desk-shell .empty,
  body.desk-shell.live-split .empty { color: #64748B; }
  body.desk-shell .card,
  body.desk-shell .job-card,
  body.desk-shell .money-block,
  body.desk-shell .board-stage {
    background: #FFFFFF;
    border-color: #E2E8F0;
    color: #0F172A;
  }
  body.desk-shell.live-split .chatpane .shop-chat {
    background: #0B1F3A;
    max-width: none;
  }
  body.desk-shell .chatpane .shop-chat,
  body.desk-shell.live-split .chatpane .shop-chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  body.desk-shell .shop-chat-head,
  body.desk-shell.live-split .shop-chat-head,
  body.desk-shell .chatpane .shop-chat-avatar,
  body.desk-shell.live-split .chatpane .shop-chat-avatar {
    display: none;
  }
  body.desk-shell .shop-chat-status,
  body.desk-shell.live-split .shop-chat-status {
    order: 1;
    flex: 0 0 auto;
    padding: .28rem .65rem;
    font-size: .74rem;
  }
  body.desk-shell .shop-chat-log,
  body.desk-shell.live-split .shop-chat-log {
    order: 2;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: .3rem .55rem .25rem;
    gap: .28rem;
    background: #0B1F3A;
  }
  body.desk-shell .shop-chat-thread,
  body.desk-shell.live-split .shop-chat-thread {
    order: 2;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #0B1F3A;
  }
  body.desk-shell .shop-chat-dock,
  body.desk-shell.live-split .shop-chat-dock {
    order: 3;
    flex: 0 0 auto;
    background: #071628;
    border-top: 1px solid rgba(43, 127, 255, 0.32);
    box-shadow: 0 -8px 18px rgba(0, 0, 0, 0.28);
  }
  body.desk-shell .shop-chat-bubble,
  body.desk-shell.live-split .shop-chat-bubble {
    padding: .26rem .5rem .22rem;
    font-size: .76rem;
    line-height: 1.25;
    border-radius: 11px;
    max-width: 92%;
  }
  body.desk-shell .shop-chat-bubble.assistant,
  body.desk-shell.live-split .shop-chat-bubble.assistant {
    background: #16325A;
    color: #E2E8F0;
  }
  body.desk-shell .shop-chat-bubble.user,
  body.desk-shell.live-split .shop-chat-bubble.user {
    background: #2B7FFF;
    color: #fff;
  }
  body.desk-shell .shop-chat-bubble.system,
  body.desk-shell.live-split .shop-chat-bubble.system {
    color: #94A3B8;
    font-size: .74rem;
    padding: .2rem .35rem;
  }
  body.desk-shell .shop-chat-pending,
  body.desk-shell.live-split .shop-chat-pending {
    order: 3;
    flex: 0 0 auto;
    padding: 0 .55rem .2rem;
  }
  body.desk-shell .shop-chat-file-err,
  body.desk-shell.live-split .shop-chat-file-err {
    order: 4;
    flex: 0 0 auto;
    margin: 0 .55rem .2rem;
  }
  body.desk-shell .shop-chat-hints,
  body.desk-shell.live-split .shop-chat-hints {
    order: 5;
    flex: 0 0 auto;
    padding: .25rem .55rem .3rem;
    gap: .3rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    background: #071628;
    -webkit-overflow-scrolling: touch;
  }
  body.desk-shell .shop-chat-hints button,
  body.desk-shell.live-split .shop-chat-hints button {
    min-height: 32px;
    flex: 0 0 auto;
    padding: .2rem .55rem;
    font-size: .74rem;
    background: transparent;
    border-color: #2B7FFF;
    color: #E2E8F0;
    white-space: nowrap;
  }
  body.desk-shell .shop-chat-form,
  body.desk-shell.live-split .shop-chat-form {
    order: 6;
    flex: 0 0 auto;
    background: #071628;
    border-top: 1px solid rgba(226, 232, 240, 0.14);
    padding: .35rem .55rem calc(.4rem + env(safe-area-inset-bottom, 0px));
    align-items: flex-end;
  }
  body.desk-shell .shop-chat-hintline,
  body.desk-shell.live-split .shop-chat-hintline { order: 7; }
  body.desk-shell .shop-chat-form textarea,
  body.desk-shell.live-split .shop-chat-form textarea {
    background: #0A1930;
    color: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.22);
    min-height: 44px;
  }
  body.desk-shell .shop-chat-form textarea:focus,
  body.desk-shell.live-split .shop-chat-form textarea:focus {
    border-color: #2B7FFF;
    background: #0A1930;
    color: #FFFFFF;
  }
  body.desk-shell .shop-chat-form button[type="submit"],
  body.desk-shell.live-split .shop-chat-form button[type="submit"] {
    width: 44px;
    height: 44px;
    background: #2B7FFF;
    color: #fff;
  }
  body.desk-shell .shop-chat-attach,
  body.desk-shell.live-split .shop-chat-attach {
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    color: #7CB4FF;
    border-color: #2B7FFF;
  }
  body.desk-shell .shop-chat-camera,
  body.desk-shell.live-split .shop-chat-camera {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid #2B7FFF;
    background: transparent;
    color: #7CB4FF;
    border-radius: 14px;
    cursor: pointer;
    flex: 0 0 auto;
  }
  body.desk-shell .shop-chat-hintline,
  body.desk-shell.live-split .shop-chat-hintline { display: none; }
  body.desk-shell .shop-chat-status.working,
  body.desk-shell.live-split .shop-chat-status.working {
    color: #2B7FFF;
    background: rgba(43, 127, 255, 0.10);
  }
  body.desk-shell .shop-chat-status.blocked,
  body.desk-shell.live-split .shop-chat-status.blocked {
    color: #FDBA74;
    background: rgba(154, 52, 18, 0.35);
  }
  body.desk-shell .live-split-toggle,
  body.desk-shell.live-split .live-split-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 52px;
    margin-left: auto;
    padding: .25rem .65rem;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #0F172A;
    border-radius: 999px;
    font: inherit;
    font-size: .78rem;
    font-weight: 650;
    cursor: pointer;
  }
  body.desk-shell.live-collapsed .shop-chat-log,
  body.desk-shell.live-collapsed .shop-chat-hints,
  body.desk-shell.live-collapsed .shop-chat-avatar,
  body.desk-shell.live-split.live-collapsed .shop-chat-log,
  body.desk-shell.live-split.live-collapsed .shop-chat-hints,
  body.desk-shell.live-split.live-collapsed .shop-chat-avatar { display: none; }
  body.desk-shell .jobfile-actions .btn,
  .jobfile-actions .btn { min-height: 44px; }
}

.doc-pay-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.doc-pay-url { font-size: 12px; color: #555; word-break: break-all; }
.doc-pay-hint { margin: 8px 0 0; }

/* —— Mobile Shop Chat (FAB + bottom-nav Chat; no peek bar) + welcome ride —— */
@media (max-width: 800px) {
  /* DEFAULT collapsed: full desk. No hide/open chat bar, no reserved strip. */
  body.desk-shell:not(.crew-mode):not(.mobile-chat-open) .desk,
  body.desk-shell.live-split:not(.crew-mode):not(.mobile-chat-open) .desk {
    grid-template-rows: minmax(0, 1fr);
  }
  body.desk-shell:not(.crew-mode):not(.mobile-chat-open) .live-chat-rail,
  body.desk-shell.live-split:not(.crew-mode):not(.mobile-chat-open) .live-chat-rail {
    display: none !important;
  }
  body.desk-shell:not(.crew-mode):not(.mobile-chat-open) .chatpane,
  body.desk-shell.live-split:not(.crew-mode):not(.mobile-chat-open) .chatpane {
    display: none !important;
  }
  body.desk-shell:not(.crew-mode):not(.mobile-chat-open):not(.mobile-tab-chat) .chat-fab {
    display: flex !important;
    position: fixed;
    right: 0.85rem;
    bottom: calc(var(--mobile-nav-h, 56px) + 4.6rem);
    z-index: 47;
    width: 56px;
    height: 56px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  body.desk-shell.mobile-chat-open:not(.mobile-tab-chat) .chat-close {
    display: inline-flex !important;
  }
  body.desk-shell:not(.crew-mode):not(.mobile-chat-open) .chatpane .shop-chat,
  body.desk-shell.live-split:not(.crew-mode):not(.mobile-chat-open) .chatpane .shop-chat {
    display: none;
  }

  /* OPEN: reuse the current locked 2/3 desk + 1/3 chat split */
  body.desk-shell.mobile-chat-open .desk,
  body.desk-shell.live-split.mobile-chat-open .desk {
    grid-template-rows: minmax(0, 67%) 28px minmax(0, 33%);
  }
  body.desk-shell.mobile-chat-open .live-chat-rail,
  body.desk-shell.live-split.mobile-chat-open .live-chat-rail {
    display: flex;
  }
  body.desk-shell.mobile-chat-open .chatpane .shop-chat,
  body.desk-shell.live-split.mobile-chat-open .chatpane .shop-chat {
    display: flex;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }

  /* Welcome first page: primary CTA on screen without scrolling */
  body.welcome-view .welcome-wrap,
  .welcome-wrap {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    padding: 0.35rem 0.65rem 0;
    align-items: stretch;
    justify-content: flex-start;
  }
  body.welcome-view .welcome-card,
  body.welcome-view .welcome-card.welcome-card-wide,
  .welcome-card,
  .welcome-card.welcome-card-wide {
    width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.7rem 0.8rem 0.55rem;
  }
  .welcome-card h1 { font-size: 1.15rem; margin-bottom: 0.3rem; }
  .welcome-lead { font-size: 0.88rem; margin-bottom: 0.35rem; }
  .welcome-body { font-size: 0.82rem; margin-bottom: 0.4rem; }
  .welcome-list {
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0 0 0.4rem;
    padding-left: 1rem;
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
  }
  .welcome-list li { margin: 0.08rem 0; }
  .welcome-card .setup-phone-num { font-size: 1.15rem; margin-bottom: 0.3rem; }
  .setup-coach-card .setup-phone-num { font-size: 1.7rem; margin-bottom: 0.45rem; }
  .welcome-brand { margin-bottom: 0.3rem; }
  .welcome-brand img,
  .welcome-brand .fieldbot-mark {
    width: 110px;
    height: auto;
    max-width: 110px;
    object-fit: contain;
  }
  .setup-unlock {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin: 0 0 0.4rem;
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
  }
  .setup-unlock-card { padding: 0.38rem 0.45rem; }
  .setup-unlock-card strong { font-size: 0.78rem; margin-bottom: 0.1rem; }
  .setup-unlock-card span { font-size: 0.68rem; line-height: 1.25; }
  .welcome-actions {
    position: sticky;
    bottom: 0;
    flex: 0 0 auto;
    margin-top: auto;
    padding: 0.45rem 0 calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(165deg, rgba(22, 30, 40, 0.98), rgba(14, 18, 24, 0.98));
    z-index: 3;
  }

  /* Ride coach: most of the screen. Never a skinny left column.
     Only rule: do not cover the currently highlighted sidebar item. */
  .setup-coach,
  .setup-coach.setup-coach-wide,
  .setup-coach.setup-coach-top,
  .setup-coach.setup-coach-bottom,
  .setup-coach.setup-coach-above-chat,
  body.setup-active.sidebar-open .setup-coach,
  body.mobile-chat-open.setup-active .setup-coach {
    left: 0.75rem;
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
    max-width: none;
    box-sizing: border-box;
  }
  .setup-coach.setup-coach-top {
    top: 0.6rem;
    bottom: auto;
    max-height: calc(42vh - 0.6rem);
    overflow: auto;
  }
  .setup-coach.setup-coach-bottom {
    bottom: 0.75rem;
    top: auto;
    max-height: calc(42vh - 0.6rem);
    overflow: auto;
  }
  .setup-coach.setup-coach-above-chat,
  body.mobile-chat-open.setup-active .setup-coach {
    top: 0.55rem;
    bottom: auto;
    max-height: calc(67% - 1.1rem);
    overflow: auto;
  }
}

/* —— Crew roster cards + portal —— */
.crew-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.crew-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.05rem 1.05rem;
  box-shadow: var(--shadow);
}
.crew-card h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.crew-card .crew-meta { color: var(--muted); font-size: 0.86rem; margin-bottom: 0.65rem; }
.crew-login-box {
  background: #F1F5F9;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font-size: 0.86rem;
}
.crew-login-box code {
  display: block;
  font-size: 0.82rem;
  word-break: break-all;
  margin: 0.15rem 0 0.45rem;
}
.crew-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.crew-login-row button { flex: 0 0 auto; }
.access-picks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.access-picks label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  min-height: var(--tap);
  width: 100%;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
}
.access-picks input {
  accent-color: var(--electric);
  width: auto;
  min-width: 1.15rem;
  min-height: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

body.crew-portal {
  background: var(--bg);
  color: #0F172A;
}
.crew-app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 0 5.5rem;
  background: var(--bg);
}
.crew-top {
  background: #0B1F3A;
  color: #fff;
  padding: 0.85rem 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.crew-top .fieldbot-mark {
  width: 132px;
  height: auto;
  max-height: 44px;
  object-fit: contain;
  background: transparent;
}
.crew-top a, .crew-top button.linkish {
  color: #fff;
  background: none;
  border: 0;
  font-weight: 600;
}
.crew-pad { padding: 1rem; }
.crew-job {
  display: block;
  background: #fff;
  border: 1px solid rgba(11,31,58,0.08);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 0 1px rgba(11,31,58,0.04);
}
.crew-job h3 { margin: 0 0 0.25rem; }
.crew-job p { margin: 0.15rem 0; color: #64748B; }
.crew-status-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin: 1rem 0;
}
.crew-status-row button {
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: #2B7FFF;
}
.crew-status-row button.is-on { background: #0B1F3A; }
.crew-note-box, .crew-photo-box, .crew-msg-box {
  background: #fff;
  border-radius: 16px;
  padding: 0.9rem;
  margin: 0.75rem 0;
  border: 1px solid rgba(11,31,58,0.08);
}
.crew-note-box textarea, .crew-msg-box textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid rgba(11,31,58,0.14);
  border-radius: 12px;
  padding: 0.65rem;
}
.crew-dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #0B1F3A;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.45rem 0.3rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
}
.crew-dock a {
  color: #94A3B8;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.4rem 0;
}
.crew-dock a.on { color: #2B7FFF; }
.crew-badge {
  display: inline-block;
  min-width: 1.1rem;
  background: #2B7FFF;
  color: #fff;
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 0 0.3rem;
}


/* Use my existing number — Settings card */
.existing-number-card .existing-number-line {
  margin: 0.35rem 0 0.75rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0B1F3A;
  word-break: break-word;
}
.existing-number-card #btnCopyFieldbotNumber {
  min-height: 48px;
  font-weight: 700;
}
.existing-copied {
  display: inline-block;
  margin-left: 10px;
  color: #2B7FFF;
  font-weight: 700;
}
.existing-vm-warn {
  margin: 0.9rem 0 0.35rem;
}
.existing-carrier {
  border: 1px solid rgba(11, 31, 58, 0.10);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0.55rem 0;
  background: var(--bg);
}
.existing-carrier h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: #0B1F3A;
  font-weight: 700;
}
.existing-carrier ol {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
}
.existing-carrier li { margin: 0.28rem 0; }
.existing-forward-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0.9rem 0 0.35rem;
  font-weight: 600;
  color: #0B1F3A;
}
.existing-forward-toggle input { margin-top: 0.2rem; }


body.crew-mode #sideNav [data-nav-group]:not([data-nav-group="open"]):not([data-nav-group="clients"]) { display: none !important; }
body.crew-mode .nav-urgent,
body.crew-mode #replayTour { display: none !important; }
body.crew-mode .amt,
body.crew-mode .bin-dollars,
body.crew-mode .home-seat-dollars,
body.crew-mode .flag.money,
body.crew-mode .money-card { display: none !important; }

.crew-shop-hits { margin: .4rem 0 0; display: grid; gap: .35rem; }
.crew-shop-hit {
  text-align: left;
  border: 1px solid var(--line, rgba(180,210,230,.2));
  background: transparent;
  color: inherit;
  padding: .45rem .65rem;
  border-radius: 8px;
  cursor: pointer;
}
.crew-shop-hit code { opacity: .7; margin-left: .35rem; }

.crew-activity { display: grid; gap: .65rem; }
.crew-activity-item {
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  border-radius: 10px;
  padding: .75rem .9rem;
}
.crew-activity-item .meta { color: #64748B; font-size: .82rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.crew-activity-item .title { font-weight: 650; margin: .2rem 0; color: #0B1F3A; }
body.crew-mode .job-snap,
body.crew-mode .amt,
body.crew-mode [data-nav-group="money"],
body.crew-mode [data-nav-group="settings"],
body.crew-mode [data-nav-group="conversations"] { display: none !important; }

body.crew-mode .job-snap,
body.crew-mode #pktText,
body.crew-mode #pktCall,
body.crew-mode #pktReceipt,
body.crew-mode #pktReceipt2,
body.crew-mode .receipt-upload,
body.crew-mode .imsg-compose,
body.crew-mode #replayTour,
body.crew-mode [data-nav-group="webchat"] { display: none !important; }


/* —— A&B public preview (durable open/closed door) —— */
.preview-banner {
  display: none;
  flex: 0 0 auto;
  padding: .35rem .85rem;
  background: #0B1F3A;
  border-bottom: 1px solid rgba(43, 127, 255, 0.28);
  color: #E2E8F0;
  font-size: .8rem;
  line-height: 1.3;
  font-weight: 650;
  z-index: 5;
}
body.is-preview .preview-banner,
.preview-banner:not([hidden]) {
  display: block;
}
body.desk-shell .preview-banner {
  flex: 0 0 auto;
}
body.is-preview .preview-banner[hidden] {
  display: block;
}


/* FIELDBOT web push — slim toast/banner (never a blocking modal) + Settings toggles */
.push-allow,
.push-toast {
  flex: 0 0 auto;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 6;
  padding: 0;
  pointer-events: auto;
  background: #0B1F3A;
  border-bottom: 1px solid rgba(43, 127, 255, 0.28);
}
.push-allow[hidden],
.push-toast[hidden] { display: none !important; }
.push-toast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  flex-wrap: wrap;
  padding: 0.42rem 0.95rem;
  min-height: 0;
}
.push-toast-copy {
  margin: 0;
  flex: 1 1 16rem;
  min-width: 0;
  color: #CBD5E1;
  font-size: 0.84rem;
  line-height: 1.35;
  font-weight: 500;
}
.push-toast-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.push-toast-actions .btn {
  min-height: 32px;
  padding: 0.28rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 650;
}
.push-toast-actions .btn-primary {
  background: #2B7FFF;
  border-color: #2B7FFF;
  color: #fff;
}
.push-toast-dismiss {
  border: 0;
  background: transparent;
  color: #94A3B8;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.28rem 0.45rem;
  cursor: pointer;
  min-height: 32px;
}
.push-toast-dismiss:hover { color: var(--ink); }
.push-settings .push-type {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(11,31,58,0.08);
}
.push-settings .push-type:last-child { border-bottom: 0; }
.push-settings .push-type span { color: #0F172A; font-weight: 600; }
.push-settings .push-type small { display: block; color: #64748B; font-weight: 400; }
.push-settings .push-switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex: 0 0 46px;
}
.push-settings .push-switch input {
  opacity: 0;
  width: 46px;
  height: 28px;
  margin: 0;
}
.push-settings .push-switch i {
  position: absolute;
  inset: 0;
  background: #CBD5E1;
  border-radius: 999px;
  pointer-events: none;
}
.push-settings .push-switch i:after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
}
.push-settings .push-switch input:checked + i { background: #2B7FFF; }
.push-settings .push-switch input:checked + i:after { left: 21px; }
.push-settings .push-allow-btn { margin-top: 0.75rem; min-height: 46px; font-weight: 700; }
@media (max-width: 860px) {
  .push-toast-inner { padding: 0.4rem 0.75rem; }
  .push-toast-copy { font-size: 0.8rem; }
}


/* Job photos — Client → Address → Photos strip */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .65rem;
}
.photo-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
  color: inherit;
  text-decoration: none;
}
.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #E2E8F0;
}
.photo-card .meta {
  padding: .45rem .55rem .55rem;
  font-size: .72rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: .4rem;
}
.photo-add-row { margin-top: .7rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
#mobileCommandQuicks { display: none !important; }
.pkt-photo-tags .photo-add-row { margin-top: 0; }
.pkt-add-photo { margin-top: .45rem; }
.shop-chat-bubble a.chat-photo { display: inline-block; }
.shop-chat-bubble a.chat-photo img {
  max-width: 160px;
  max-height: 160px;
  border-radius: 10px;
  display: block;
  margin: .35rem 0;
}

/* —— Desktop Live + Chat polish (min-width 861). Layout / nav / theme unchanged. —— */
@media (min-width: 861px) {
  body.desk-shell .chatpane {
    box-shadow: inset 3px 0 0 #2B7FFF, -8px 0 16px rgba(0, 0, 0, 0.14);
  }
  body.desk-shell .chatpane .shop-chat-head {
    padding: .55rem .8rem .5rem;
  }
  body.desk-shell .chatpane .shop-chat-head h1 { font-size: .92rem; }
  body.desk-shell .chatpane .shop-chat-head .sub { font-size: .75rem; }
  body.desk-shell .chatpane .shop-chat-avatar { width: 28px; }
  body.desk-shell .chatpane .shop-chat-log {
    padding: .7rem .8rem .85rem;
    gap: .42rem;
  }
  body.desk-shell .chatpane .shop-chat-bubble {
    padding: .42rem .65rem .38rem;
    font-size: .86rem;
    line-height: 1.38;
    max-width: min(86%, 28rem);
    border-radius: 14px;
  }
  body.desk-shell .chatpane .shop-chat-bubble.system {
    font-size: .76rem;
    padding: .2rem .4rem;
    max-width: 22rem;
    opacity: .92;
  }
  body.desk-shell .chatpane .shop-chat-bubble[data-chat-placeholder="1"] {
    opacity: .88;
    font-style: normal;
  }
  body.desk-shell .chatpane .shop-chat-status {
    padding: .32rem .8rem;
    font-size: .74rem;
  }
  body.desk-shell .chatpane .shop-chat-hints {
    gap: .3rem;
    padding: .35rem .8rem .25rem;
  }
  body.desk-shell .chatpane .shop-chat-hints button {
    padding: .2rem .5rem;
    font-size: .72rem;
  }
  body.desk-shell .chatpane .shop-chat-form {
    padding: .55rem .8rem .7rem;
  }
  body.desk-shell .chatpane .shop-chat-form textarea { min-height: 44px; }
  body.desk-shell .chatpane .shop-chat-hintline {
    padding: 0 .8rem .55rem;
    font-size: .72rem;
  }
  body.desk-shell .chatpane .shop-chat-links {
    margin-top: .28rem;
    display: flex;
    flex-wrap: wrap;
    gap: .28rem;
  }
  body.desk-shell .chatpane .shop-chat-pending { padding: .3rem .8rem .2rem; }

  body.desk-shell .mainpane-body { padding: 1.3rem 1.4rem 2.35rem; }
  body.desk-shell .live-desk .page-head { margin: 0 0 .85rem; }
  body.desk-shell .live-quick {
    margin: 0 0 1.35rem;
    padding: .85rem .95rem .9rem;
  }
  body.desk-shell .live-quick-lead {
    margin: 0 0 .5rem;
    font-size: .92rem;
    font-weight: 650;
  }
  body.desk-shell .live-quick-chips { gap: .38rem; }
  body.desk-shell .live-quick-chip {
    min-height: 34px;
    padding: .34rem .72rem;
    font-size: .82rem;
  }
  body.desk-shell .live-feed {
    gap: 1.35rem;
    margin-top: .2rem;
  }
  body.desk-shell .live-section {
    padding: 1.1rem 1.15rem 1.2rem;
  }
  body.desk-shell .live-section-head { margin: 0 0 .8rem; }
  body.desk-shell .live-section-list {
    gap: .7rem;
    grid-template-columns: minmax(0, 1fr);
  }
  body.desk-shell .live-row {
    align-items: flex-start;
    flex-wrap: wrap;
    height: auto;
    min-height: 4.5rem;
    padding: .85rem .95rem;
    gap: .28rem .85rem;
  }
  body.desk-shell .live-when {
    flex: 0 1 auto;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  body.desk-shell .live-main {
    flex: 1 1 12rem;
    min-width: 0;
  }
  body.desk-shell .live-main .name,
  body.desk-shell .live-main .meta {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  body.desk-shell .live-row-empty {
    min-height: 4.75rem;
    align-items: center;
  }
  body.desk-shell .live-row-empty .name {
    color: #64748B;
    font-weight: 500;
    white-space: normal;
  }
}


/* —— Mobile operator tool (desktop chrome unchanged) —— */
.mobile-bottom-nav,
.mobile-more-sheet,
.mobile-command { display: none; }
.mobile-desk { display: none; }
.fb-desk-widget { display: none; }
.desk-toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  z-index: 80;
  max-width: 92vw;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: #0B1F3A;
  color: #fff;
  font-weight: 650;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.desk-toast:not([hidden]) { display: block; }
.doc-line-list { display: flex; flex-direction: column; gap: 0.75rem; }
.doc-line {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
}
.doc-line input, .doc-line textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
.doc-send-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}
.doc-send-row .btn {
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 700;
}
.live-op-command-row {
  display: flex;
  gap: 0.5rem;
}
.live-op-command-row input {
  flex: 1;
  min-height: 48px;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}
.live-money-snap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.live-money-snap > * {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 0.85rem;
  min-height: var(--chat-sliver, 108px);
}
.live-money-snap span { display: block; color: #64748B; font-size: 0.75rem; }
.live-money-snap b { font-size: 1.15rem; }

@media (max-width: 860px) {
  body.desk-shell {
    --mobile-nav-h: calc(56px + env(safe-area-inset-bottom, 0px));
    --tap: var(--fb-tap, 52px);
    font-size: var(--fb-body, 16px);
    line-height: var(--fb-lh, 1.5);
  }
  body.desk-shell .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 200;
    min-height: var(--mobile-nav-h);
    padding: 0.2rem 0.15rem calc(0.2rem + env(safe-area-inset-bottom, 0px));
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  body.desk-shell .mobile-bottom-nav [hidden] { display: none !important; }
  body.desk-shell.crew-mode .mobile-bottom-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.desk-shell .mobile-bottom-nav a,
  body.desk-shell .mobile-bottom-nav button {
    appearance: none;
    background: transparent;
    border: 0;
    color: #94A3B8;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    min-height: 48px;
    text-align: center;
    padding: 0.35rem 0.1rem;
  }
  body.desk-shell .mobile-bottom-nav .on { color: #2B7FFF; }
  body.desk-shell .mobile-bottom-nav .nav-count {
    display: inline-block;
    min-width: 1.1rem;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.2;
  }
  body.desk-shell .mobile-command {
    display: flex;
    position: fixed;
    left: 0.65rem; right: 0.65rem;
    bottom: calc(var(--mobile-nav-h) + 0.45rem);
    z-index: 46;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 0.35rem 0.35rem 0.35rem 0.7rem;
    box-shadow: 0 8px 20px rgba(11,31,58,0.12);
  }
  body.desk-shell .mobile-command[hidden] { display: none; }
  body.desk-shell .mobile-command input {
    flex: 1;
    min-height: 44px;
    border: 0;
    background: transparent;
  }
  body.desk-shell .mobile-command button {
    min-width: 52px;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: #2B7FFF;
    color: #fff;
    font-weight: 800;
  }
  body.desk-shell .mobile-more-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0,0,0,0.25);
    align-items: flex-end;
    justify-content: center;
    pointer-events: auto;
  }
  body.desk-shell .mobile-more-sheet:not([hidden]) { display: flex; }
  body.desk-shell .mobile-more-card {
    width: 100%;
    max-height: 78vh;
    overflow: auto;
    background: var(--bg);
    border-radius: 18px 18px 0 0;
    padding: 0.85rem 0.85rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  body.desk-shell .mobile-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }
  body.desk-shell .mobile-more-head h2 {
    font-size: 1.1rem;
    letter-spacing: 0;
    text-transform: none;
    color: #0F172A;
  }
  body.desk-shell .mobile-more-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  body.desk-shell .mobile-more-nav a {
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0 0.9rem;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-weight: 650;
  }
  body.desk-shell .desk-col,
  body.desk-shell .shell {
    padding-bottom: 0;
  }
  body.desk-shell .desk,
  body.desk-shell.live-split .desk {
    padding-bottom: 0;
    max-height: calc(var(--desk-vh, 100dvh) - var(--mobile-nav-h));
  }
  body.desk-shell .sidebar {
    bottom: var(--mobile-nav-h);
  }
  body.desk-shell .live-op .live-section { margin-bottom: 1.25rem; }
  body.desk-shell .live-op .live-quick { margin: 0.35rem 0 0; }
  body.desk-shell .live-op .live-section-title { margin-bottom: 0.45rem; }
  body.desk-shell .jobfile-actions .btn,
  body.desk-shell .doc-send-row .btn,
  body.desk-shell .live-quick-chip {
    min-height: 48px;
  }
  body.desk-shell.mobile-doc-mode .doc-ws-main {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 100%;
  }
  body.desk-shell.mobile-doc-mode .doc-ws-main-card {
    display: flex;
    flex-direction: column;
    min-height: calc(var(--desk-vh, 100dvh) - var(--mobile-nav-h) - 3.2rem);
    border: 0;
    box-shadow: none;
    background: #fff;
  }
  body.desk-shell.mobile-doc-mode .doc-ws-preview {
    min-height: 42vh;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
  }
  body.desk-shell.mobile-doc-mode .doc-ws-preview iframe {
    width: 100%;
    min-height: 42vh;
    border: 0;
  }
  body.desk-shell.mobile-doc-mode .doc-ws-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 0.6rem 0 0.2rem;
  }
  body.desk-shell[data-role="crew"] .live-money-sec,
  body.desk-shell[data-role="crew"] .live-leads-sec,
  body.desk-shell[data-role="crew"] .job-snap,
  body.desk-shell[data-role="crew"] #moneyFoot { display: none; }
  body.desk-shell:not(.mobile-tab-chat):not(.mobile-doc-mode) .mainpane-body {
    padding-bottom: 4.6rem;
  }
  body.desk-shell.mobile-doc-mode .doc-ws-actions table { display: none; }
}

@media (max-width: 800px) {
  body.desk-shell.mobile-tab-chat .desk,
  body.desk-shell.live-split.mobile-tab-chat .desk {
    grid-template-rows: minmax(0, 1fr) !important;
    max-height: calc(var(--desk-vh, 100dvh) - var(--mobile-nav-h));
  }
  body.desk-shell.mobile-tab-chat .mainpane,
  body.desk-shell.mobile-tab-chat .live-chat-rail {
    display: none !important;
  }
  body.desk-shell.mobile-tab-chat .chatpane,
  body.desk-shell.live-split.mobile-tab-chat .chatpane {
    display: flex !important;
    min-height: 0;
    max-height: none;
    border-top: 0;
  }
  body.desk-shell.mobile-tab-chat .chatpane .shop-chat,
  body.desk-shell.live-split.mobile-tab-chat .chatpane .shop-chat {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }
  body.desk-shell.mobile-tab-chat .mobile-command { display: none !important; }
  body.desk-shell .setup-coach.setup-coach-bottom,
  body.desk-shell.mobile-chat-open .setup-coach.setup-coach-bottom {
    bottom: calc(var(--mobile-nav-h, 56px) + 0.55rem);
  }
  body.desk-shell .setup-coach,
  body.desk-shell .setup-coach.setup-coach-wide {
    max-width: none;
  }
}


/* —— Shared field-app patterns (desktop can reuse next) —— */
.status-led {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--fb-line, rgba(243,238,228,.12));
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--fb-ink, #F3EEE4);
  background: var(--fb-bg-2, #0B1220);
  white-space: nowrap;
}
.status-led-icon { font-weight: 800; }
.status-led.status-ok { color: #166534; border-color: #166534; background: #DCFCE7; }
.status-led.status-warn { color: #854D0E; border-color: #854D0E; background: #FEF3C7; }
.status-led.status-bad { color: #B91C1C; border-color: #B91C1C; background: #FEE2E2; }
.status-led.status-info { color: #1E3A8A; border-color: #1E3A8A; background: #DBEAFE; }
.list-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: var(--fb-row, 56px);
  padding: 0.7rem 0.85rem;
  background: var(--fb-bg-2, #0B1220);
  border: 1px solid var(--fb-line, rgba(243,238,228,.12));
  border-radius: 12px;
  color: var(--fb-ink, #F3EEE4);
}
.list-row-lead { flex: 0 0 auto; }
.list-row-body { flex: 1 1 auto; min-width: 0; }
.list-row-trail { flex: 0 0 auto; font-weight: 650; color: var(--fb-muted, #9AA3B2); }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 4.75rem;
  padding: 0.95rem;
  background: var(--fb-bg-2, #0B1220);
  border: 1px solid var(--fb-line, rgba(243,238,228,.12));
  border-radius: 12px;
}
.empty-state-title { font-weight: 700; color: var(--fb-ink, #F3EEE4); }
.empty-state-body { color: var(--fb-muted, #9AA3B2); }
.hero-status {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0 0.4rem;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.action-row .btn { min-height: 52px; }
.info-block {
  background: var(--fb-bg-2, #0B1220);
  border: 1px solid var(--fb-line, rgba(243,238,228,.12));
  border-radius: 12px;
  padding: 0.85rem;
}
.list-toolbar {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}
.list-filter {
  flex: 1;
  min-height: 52px;
  border: 1px solid var(--fb-line, rgba(243,238,228,.12));
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 16px;
}
.action-card {
  margin-top: 0.55rem;
  padding: 0.75rem 0.8rem;
  border: 2px solid #2B7FFF;
  border-radius: 12px;
  background: #FFFFFF;
  color: #0F172A;
}
.action-card-title { font-weight: 800; margin: 0 0 0.35rem; }
.action-card-body { margin: 0 0 0.65rem; white-space: pre-wrap; }
.action-card-ids { font-size: 0.78rem; color: #334155; margin: 0 0 0.55rem; }
.action-card .btn { min-height: 52px; width: 100%; }
.theme-toggle {
  display: none;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid #0B1F3A;
  border-radius: 12px;
  background: #FFFFFF;
  color: #0B1F3A;
  font-weight: 800;
  cursor: pointer;
}
.top-chrome-cluster { display: none; }
.nav-ico { display: none; }
.nav-lab { display: block; line-height: 1.15; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Mobile field-app polish (desktop chrome unchanged) —— */
@media (max-width: 860px) {
  html.desk-ready,
  body.desk-shell {
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
    font-size: var(--fb-body, 16px);
    line-height: var(--fb-lh, 1.5);
    font-weight: 400;
  }
  body.desk-shell .mainpane,
  body.desk-shell.live-split .mainpane,
  body.desk-shell .main-stage,
  body.desk-shell .mainpane-body {
    background: var(--bg);
    color: #E8E8E8;
  }
  body.desk-shell .owner-sticky.top-chrome,
  body.desk-shell.live-split .owner-sticky.top-chrome {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.45rem;
    min-height: 64px;
    height: auto;
    padding: 8px 12px;
    background: #000000;
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  body.desk-shell .top-chrome-cluster {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    min-width: 0;
  }
  body.desk-shell .top-chrome-shop {
    font-size: 0.82rem;
    font-weight: 800;
    color: #FFFFFF;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 38vw;
  }
  body.desk-shell .theme-toggle { display: inline-grid; place-items: center; }
  body.desk-shell .owner-sticky .mobile-menu,
  body.desk-shell.live-split .owner-sticky .mobile-menu {
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #000000;
    min-width: 48px;
    min-height: 48px;
  }
  body.desk-shell .mobile-bottom-nav {
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
  }
  body.desk-shell .mobile-bottom-nav a,
  body.desk-shell .mobile-bottom-nav button {
    color: #8A8A8A;
    font-size: 0.68rem;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    font-weight: 800;
  }
  body.desk-shell .mobile-bottom-nav .nav-ico {
    display: block;
    font-size: 1.05rem;
    line-height: 1;
    color: #8A8A8A;
  }
  body.desk-shell .mobile-bottom-nav .on { color: #2B7FFF; }
  body.desk-shell .mobile-bottom-nav .on .nav-ico { color: #2B7FFF; }
  body.desk-shell .mobile-command {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #FFFFFF;
    border: 2px solid #0B1F3A;
    box-shadow: 0 8px 20px rgba(11, 31, 58, 0.16);
    padding: 0.4rem 0.45rem;
  }
  body.desk-shell .mobile-command-quicks {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.desk-shell .mobile-command-quick {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0.25rem 0.65rem;
    border: 1px solid #0B1F3A;
    border-radius: 999px;
    background: #FFFFFF;
    color: #0B1F3A;
    font-weight: 700;
    font-size: 0.78rem;
  }
  body.desk-shell .mobile-command-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
  }
  body.desk-shell .mobile-command input {
    min-height: 52px;
    font-size: 16px;
    color: #0F172A;
  }
  body.desk-shell .mobile-command button {
    min-width: 72px;
    min-height: 52px;
    background: #2B7FFF;
    color: #FFFFFF;
    font-weight: 800;
  }
  body.desk-shell .btn-primary,
  body.desk-shell .doc-send-row .btn,
  body.desk-shell .jobfile-actions .btn-primary,
  body.desk-shell .action-row .btn-primary,
  body.desk-shell .imsg-compose .btn-primary {
    min-height: var(--fb-tap, 52px);
    font-weight: 800;
    background: var(--fb-primary, #2B7FFF);
    border-color: var(--fb-primary, #2B7FFF);
    color: var(--fb-primary-ink, #FFFFFF);
  }
  body.desk-shell .live-row,
  body.desk-shell .imsg-row,
  body.desk-shell .list-row,
  body.desk-shell .pkt {
    min-height: 56px;
    border-color: #64748B;
    background: #FFFFFF;
  }
  body.desk-shell .live-main .name,
  body.desk-shell .imsg-row .name {
    font-weight: 700;
    color: #0F172A;
  }
  body.desk-shell .live-main .meta,
  body.desk-shell .imsg-preview {
    color: #334155;
  }
  body.desk-shell .live-row-empty,
  body.desk-shell .empty-state {
    background: #FFFFFF;
    border: 1px solid #64748B;
  }
  body.desk-shell input,
  body.desk-shell select,
  body.desk-shell textarea {
    min-height: 48px;
    border-color: #64748B;
    font-size: 16px;
  }
  body.desk-shell .more-theme-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.55rem;
  }
  body.desk-shell .more-theme-row button {
    flex: 1;
    min-height: 52px;
    border: 1px solid #0B1F3A;
    border-radius: 12px;
    background: #FFFFFF;
    color: #0B1F3A;
    font-weight: 800;
  }
}

@media (max-width: 860px) {
  html[data-theme="dark"].desk-ready,
  html[data-theme="dark"] body.desk-shell {
    background: var(--fb-bg);
    color: var(--fb-ink);
  }
  html[data-theme="dark"] body.desk-shell .mainpane,
  html[data-theme="dark"] body.desk-shell .main-stage,
  html[data-theme="dark"] body.desk-shell .mainpane-body,
  html[data-theme="dark"] body.desk-shell .owner-sticky.top-chrome,
  html[data-theme="dark"] body.desk-shell .mobile-bottom-nav,
  html[data-theme="dark"] body.desk-shell .mobile-command,
  html[data-theme="dark"] body.desk-shell .mobile-more-card,
  html[data-theme="dark"] body.desk-shell .live-row,
  html[data-theme="dark"] body.desk-shell .list-row,
  html[data-theme="dark"] body.desk-shell .empty-state {
    background: #102744;
    color: var(--ink);
    border-color: #94A3B8;
  }
  html[data-theme="dark"] body.desk-shell .top-chrome-shop,
  html[data-theme="dark"] body.desk-shell .owner-sticky .mobile-menu,
  html[data-theme="dark"] body.desk-shell .theme-toggle,
  html[data-theme="dark"] body.desk-shell .mobile-bottom-nav a,
  html[data-theme="dark"] body.desk-shell .mobile-bottom-nav button {
    color: var(--ink);
    border-color: #94A3B8;
  }
}

@media (max-width: 860px) {
  html[data-hc="1"] body.desk-shell .live-row,
  html[data-hc="1"] body.desk-shell .list-row,
  html[data-hc="1"] body.desk-shell .imsg-row,
  html[data-hc="1"] body.desk-shell .mobile-command,
  html[data-hc="1"] body.desk-shell input,
  html[data-hc="1"] body.desk-shell textarea,
  html[data-hc="1"] body.desk-shell select {
    border-color: #0B1F3A;
    border-width: 2px;
  }
  html[data-hc="1"] body.desk-shell .live-main .meta,
  html[data-hc="1"] body.desk-shell .imsg-preview {
    color: #0F172A;
  }
}


/* —— Desktop ops desk (min-width 861). Mobile chrome unchanged. —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.desk-topbar,
.right-dock-toggle,
.nav-sub { display: none; }
.stage-detail { display: none; }

@media (min-width: 861px) {
  body.desk-shell .mobile-bottom-nav,
  body.desk-shell .mobile-command,
  body.desk-shell .persistent-chat-bar,
  body.desk-shell .mobile-more-sheet,
  body.desk-shell .chat-fab,
  body.desk-shell .fb-desk-widget,
  body.desk-shell .fb-desk-widget-btn,
  body.desk-shell #fbDeskWidget,
  body.desk-shell #fbDeskWidgetBtn,
  body.desk-shell .owner-sticky,
  body.desk-shell .mobile-desk {
    display: none !important;
  }

  body.desk-shell .desk-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    flex: 0 0 auto;
    min-height: 56px;
    padding: 0.4rem 0.9rem;
    background: var(--fb-bg-2, #0A0A0A);
    color: var(--fb-ink, #E8E8E8);
    border-bottom: 1px solid var(--fb-line, #2A2A2A);
    box-shadow: var(--fb-shadow, 0 0 0 1px #64748B);
    z-index: 30;
  }
  body.desk-shell .desk-topbar-shop {
    flex: 0 1 14rem;
    min-width: 0;
    font-weight: 800;
    color: var(--fb-ink, #F3EEE4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.desk-shell .desk-topbar-search {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
  }
  body.desk-shell .desk-topbar-search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 10px;
    padding: 0.45rem 0.8rem;
    background: var(--fb-bg, #000000);
    color: var(--fb-ink, #E8E8E8);
    font-size: 16px;
  }
  body.desk-shell .desk-topbar-search input:focus {
    outline: 3px solid var(--fb-primary, #2B7FFF);
    outline-offset: 2px;
    border-color: var(--fb-primary, #2B7FFF);
  }
  body.desk-shell #deskTopBarStatus { margin-left: auto; }

  body.desk-shell .sidebar.left-sidebar {
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
    border-right: 1px solid var(--fb-line, rgba(243,238,228,.12));
  }
  body.desk-shell .sidebar-toggle,
  body.desk-shell .right-dock-toggle,
  body.desk-shell .live-split-toggle { display: none !important; }
  body.desk-shell .sidebar-nav a {
    color: var(--fb-ink, #F3EEE4);
    min-height: 44px;
  }
  body.desk-shell .sidebar-nav a:hover,
  body.desk-shell .sidebar-nav a:focus-visible {
    background: var(--fb-info-bg, #DBEAFE);
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell .sidebar-nav a.on {
    background: var(--fb-info-bg, #DBEAFE);
    color: var(--fb-ink-2, #111827);
    box-shadow: inset 3px 0 0 var(--fb-primary, #2B7FFF);
  }
  body.desk-shell .nav-sub {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--fb-muted, #9AA3B2);
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }
  body.desk-shell.sidebar-collapsed .nav-sub { display: none; }
  body.desk-shell .sidebar-foot a,
  body.desk-shell .sidebar-help { color: var(--fb-muted, #9AA3B2); }

  body.desk-shell .mainpane,
  body.desk-shell .main-stage,
  body.desk-shell .mainpane-body {
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell .home-wrap.conv-wrap,
  body.desk-shell .conv-wrap.imsg-inbox,
  body.desk-shell .conv-wrap.conv-split {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  body.desk-shell .conv-wrap.imsg-inbox:not(.thread-wrap) .imsg-inbox-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  body.desk-shell .conv-wrap.imsg-inbox:not(.thread-wrap) .imsg-thread-empty {
    display: none;
  }
  body.desk-shell .main-stage.stage-md {
    display: block;
  }
  body.desk-shell .stage-split {
    display: block;
    min-height: 0;
  }
  body.desk-shell .stage-detail {
    display: none;
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 12px;
    padding: 0.9rem 1rem;
    min-height: 8rem;
  }
  body.desk-shell .stage-detail-card h2 {
    margin: 0 0 0.35rem;
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell .stage-detail-card .meta {
    color: var(--fb-muted, #9AA3B2);
    margin: 0 0 0.8rem;
  }

  body.desk-shell .right-dock-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 8px;
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
    font-weight: 800;
    cursor: pointer;
  }
  body.desk-shell.dock-collapsed .desk,
  body.desk-shell.live-split.dock-collapsed .desk {
    grid-template-columns: minmax(0, 1fr) 36px 52px;
  }
  body.desk-shell.dock-collapsed .right-dock .shop-chat-thread,
  body.desk-shell.dock-collapsed .right-dock .shop-chat-status {
    display: none;
  }

  body.desk-shell :focus-visible {
    outline: 3px solid var(--fb-primary, #2B7FFF);
    outline-offset: 2px;
  }

  body.desk-shell .desk-table,
  body.desk-shell .money-block,
  body.desk-shell .money-page,
  body.desk-shell .imsg-row,
  body.desk-shell .pkt,
  body.desk-shell .live-row,
  body.desk-shell .list-row {
    color: var(--fb-ink, #F3EEE4);
    border-color: var(--fb-line, rgba(243,238,228,.12));
    background: var(--fb-bg-2, #0B1220);
  }
  body.desk-shell .desk-table th,
  body.desk-shell .desk-table td,
  body.desk-shell .money-snap span,
  body.desk-shell .live-main .meta,
  body.desk-shell .imsg-preview {
    color: var(--fb-muted, #9AA3B2);
  }
  body.desk-shell .money-snap b,
  body.desk-shell .live-main .name,
  body.desk-shell .pkt .name {
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell .action-card {
    border-color: var(--fb-primary, #2B7FFF);
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
  }
}

@media (min-width: 1280px) {
  body.desk-shell .main-stage.stage-md .stage-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 38%);
    gap: 1rem;
    align-items: start;
  }
  body.desk-shell .main-stage.stage-md .stage-detail {
    display: block;
    position: sticky;
    top: 0.75rem;
  }
  body.desk-shell .main-stage.is-power .stage-split {
    display: block;
  }
  body.desk-shell .main-stage.is-power .stage-detail {
    display: none;
  }
}

@media (min-width: 861px) {
  html[data-hc="1"] body.desk-shell .desk-table,
  html[data-hc="1"] body.desk-shell .money-block,
  html[data-hc="1"] body.desk-shell .pkt,
  html[data-hc="1"] body.desk-shell .live-row,
  html[data-hc="1"] body.desk-shell .imsg-row,
  html[data-hc="1"] body.desk-shell .stage-detail,
  html[data-hc="1"] body.desk-shell .desk-topbar-search input {
    border-color: var(--fb-line, #0B1F3A);
    border-width: 2px;
  }
}


/* —— Mobile desk (The Desk, max-width 860). Desktop chrome unchanged. —— */
.mobile-desk { display: none; }
.live-doc-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
  background: var(--fb-bg-2, #0B1220);
  color: var(--fb-ink, #F3EEE4);
  border: 2px solid var(--fb-primary, #2B7FFF);
  border-radius: var(--fb-radius, 14px);
}
.live-doc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.live-doc-type {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--fb-navy, #0B1F3A);
}
.live-doc-fields { display: flex; flex-direction: column; gap: 0.35rem; }
.live-doc-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: var(--fb-tap, 52px);
  padding: 0 0.75rem;
  border: 1px solid var(--fb-line, rgba(243,238,228,.12));
  border-radius: 12px;
  background: var(--fb-bg, #070B12);
  color: var(--fb-ink, #F3EEE4);
  font: inherit;
  text-align: left;
}
.live-doc-k { font-weight: 700; text-transform: capitalize; color: var(--fb-muted, #9AA3B2); }
.live-doc-v { font-weight: 650; }
.live-doc-q { margin: 0; font-size: var(--fb-body, 16px); }
.live-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.live-doc-actions .btn {
  min-height: var(--fb-tap, 52px);
  flex: 1 1 46%;
}

@media (max-width: 860px) {
  body.desk-shell {
    --mobile-nav-h: calc(56px + env(safe-area-inset-bottom, 0px));
    --tap: var(--fb-tap, 52px);
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
    font-size: var(--fb-body, 16px);
  }
  body.desk-shell .sidebar,
  body.desk-shell .desk-topbar,
  body.desk-shell .live-chat-rail,
  body.desk-shell .chatpane,
  body.desk-shell.mobile-tab-chat .chatpane,
  body.desk-shell.mobile-chat-open .chatpane,
  body.desk-shell.live-split.mobile-tab-chat .chatpane,
  body.desk-shell.live-split.mobile-chat-open .chatpane,
  body.desk-shell .owner-sticky,
  body.desk-shell .chat-fab,
  body.desk-shell:not(.crew-mode):not(.mobile-chat-open):not(.mobile-tab-chat) .chat-fab,
  body.desk-shell.mobile-chat-open .chat-fab,
  body.desk-shell.mobile-tab-chat .chat-fab,
  body.desk-shell .right-dock-toggle,
  body.desk-shell .mobile-command,
  body.desk-shell .chat-backdrop {
    display: none !important;
  }
  body.desk-shell.sidebar-open .sidebar {
    display: flex !important;
    transform: translateX(0);
    z-index: 60;
    pointer-events: auto;
  }
  body.desk-shell #sideNav,
  body.desk-shell #sideNav a[data-link] {
    pointer-events: auto;
  }
  body.desk-shell:not(.welcome-view) .mobile-desk {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0;
    bottom: var(--mobile-nav-h);
    z-index: 40;
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell.welcome-view .mobile-desk { display: none !important; }
  body.desk-shell.mobile-page-open .mobile-desk { display: none !important; }
  body.desk-shell.mobile-page-open .mainpane,
  body.desk-shell.mobile-page-open #app,
  body.desk-shell.mobile-page-open .main-stage {
    display: block !important;
    position: relative;
    z-index: 1;
    padding-bottom: calc(var(--mobile-nav-h) + 16px);
    min-height: 100dvh;
    overflow: auto;
  }
  body.desk-shell .mobile-desk-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex: 0 0 auto;
    min-height: 56px;
    padding: calc(0.4rem + var(--fb-safe-top, 0px)) 0.85rem 0.4rem;
    background: #000000;
    color: #FFFFFF;
  }
  body.desk-shell .mobile-desk-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
  }
  body.desk-shell .mobile-desk-logo {
    width: auto;
    height: 36px;
    max-width: 120px;
    object-fit: contain;
  }
  body.desk-shell .mobile-desk-shop {
    font-weight: 800;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.desk-shell .mobile-desk-sub { font-size: 0.75rem; color: #E2E8F0; }
  body.desk-shell .mobile-desk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0 0.85rem;
    border: 0;
    border-radius: 999px;
    background: #B91C1C;
    color: #FFFFFF;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
  }
  body.desk-shell .mobile-desk-badge.is-zero {
    background: rgba(255,255,255,0.12);
    color: #E2E8F0;
  }
  body.desk-shell #mobileDeskBadgeCount {
    min-width: 1.15rem;
    text-align: center;
  }
  body.desk-shell .mobile-desk-home {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.85rem 0.85rem 5.5rem;
  }
  body.desk-shell .mobile-desk-urgent-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--fb-tap, 52px);
    padding: 0.85rem 1rem;
    margin: 0 0 1rem;
    border: 0;
    border-radius: 14px;
    background: #B91C1C;
    color: #FFFFFF;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  body.desk-shell .mobile-desk-urgent-card b { font-size: 1.05rem; }
  body.desk-shell .mobile-desk-home-h {
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fb-muted, #9AA3B2);
  }
  body.desk-shell .mobile-desk-home-empty {
    padding: 1rem 0.2rem;
    color: var(--fb-muted, #9AA3B2);
  }
  body.desk-shell .mobile-desk-panes {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.desk-shell .mobile-pane {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.desk-shell .mobile-pane[hidden] { display: none !important; }
  body.desk-shell .mobile-desk-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.75rem 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overscroll-behavior: contain;
  }
  body.desk-shell .mobile-desk-bubble {
    max-width: 92%;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    font-size: var(--fb-body, 16px);
    line-height: 1.45;
    white-space: pre-wrap;
  }
  body.desk-shell .mobile-desk-bubble.user {
    align-self: flex-end;
    background: var(--fb-primary, #2B7FFF);
    color: #FFFFFF;
  }
  body.desk-shell .mobile-desk-bubble.assistant,
  body.desk-shell .mobile-desk-bubble.system {
    align-self: flex-start;
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
  }
  body.desk-shell .mobile-desk-dock {
    flex: 0 0 auto;
    padding: 0.45rem 0.65rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background: var(--fb-bg-2, #0B1220);
    border-top: 3px solid var(--fb-primary, #2B7FFF);
  }
  body.desk-shell .mobile-desk-chips {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.15rem 0 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  body.desk-shell .mobile-desk-chip {
    flex: 0 0 auto;
    min-height: var(--fb-tap, 52px);
    padding: 0 0.95rem;
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 999px;
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
  }
  body.desk-shell .mobile-desk-form {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
  }
  body.desk-shell .mobile-desk-form textarea {
    flex: 1 1 auto;
    resize: none;
    min-height: 44px;
    max-height: 140px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 20px;
    padding: 0.7rem 0.95rem;
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    background: #f5f5f7;
    color: var(--fb-ink, #F3EEE4);
    -webkit-appearance: none;
    appearance: none;
  }
  body.desk-shell .mobile-desk-form textarea:focus {
    outline: none;
    border-color: #2B7FFF;
    background: #fff;
  }
  body.desk-shell .mobile-desk-form button {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 50%;
    font-weight: 800;
  }
  body.desk-shell #mobileDeskAttach,
  body.desk-shell #mobileDeskMic {
    background: #f5f5f7;
    color: #0B1F3A;
    border: 1px solid rgba(15, 23, 42, 0.12);
  }
  body.desk-shell #mobileDeskMic.on {
    background: #2B7FFF;
    color: #fff;
    border-color: #2B7FFF;
  }
  body.desk-shell .mobile-desk-form .btn-primary {
    background: #2B7FFF;
    color: #fff;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 0.78rem;
  }
  body.desk-shell .mobile-glance {
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }
  body.desk-shell .mobile-glance-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: var(--fb-row, 56px);
    padding: 0.85rem;
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 14px;
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
    text-align: left;
    font: inherit;
  }
  body.desk-shell .mobile-glance-card b { font-size: 1.05rem; }
  body.desk-shell .mobile-glance-card span { color: var(--fb-muted, #9AA3B2); }
  body.desk-shell .mobile-more-list {
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }
  body.desk-shell .mobile-more-list a,
  body.desk-shell .mobile-more-list button {
    min-height: var(--fb-tap, 52px);
    display: flex;
    align-items: center;
    padding: 0 0.9rem;
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 12px;
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
    font: inherit;
    font-weight: 650;
  }
  body.desk-shell .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 200;
    min-height: var(--mobile-nav-h);
    padding: 0.2rem 0.15rem calc(0.2rem + env(safe-area-inset-bottom, 0px));
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  body.desk-shell .mobile-bottom-nav [hidden] { display: none !important; }
  body.desk-shell.crew-mode .mobile-bottom-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.desk-shell .mobile-bottom-nav a,
  body.desk-shell .mobile-bottom-nav button {
    appearance: none;
    background: transparent;
    border: 0;
    color: #E2E8F0;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    min-height: 48px;
  }
  body.desk-shell .mobile-bottom-nav .on { color: #2B7FFF; }

  body.desk-shell .fb-desk-widget {
    display: block;
  }
  body.desk-shell .fb-desk-widget-btn {
    position: fixed;
    right: 16px;
    bottom: calc(var(--mobile-nav-h) + 12px);
    z-index: 60;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: #0B1F3A;
    box-shadow: 0 8px 24px rgba(11,31,58,.28);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  body.desk-shell .fb-desk-widget-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
  body.desk-shell .fb-desk-widget-win {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(var(--mobile-nav-h) + 76px);
    z-index: 61;
    height: 100dvh;
    background: var(--bg);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(11,31,58,.22);
    border: 1px solid rgba(11,31,58,.08);
    display: none;
    flex-direction: column;
    overflow: hidden;
  }
  body.desk-shell .fb-desk-widget-win.open,
  body.desk-shell.fb-desk-widget-open .fb-desk-widget-win {
    display: flex;
  }
  body.desk-shell .fb-desk-widget-head {
    background: #0B1F3A;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 auto;
  }
  body.desk-shell .fb-desk-widget-head img {
    height: 28px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
  }
  body.desk-shell #fbDeskWidgetClose {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    min-width: 44px;
    min-height: 44px;
  }
  body.desk-shell .fb-desk-widget-win .mobile-desk-thread {
    flex: 1 1 auto;
    min-height: 0;
    background: var(--bg);
  }
  body.desk-shell .fb-desk-widget-win .mobile-desk-dock {
    flex: 0 0 auto;
    background: #fff;
    border-top: 1px solid rgba(11,31,58,.08);
    padding-bottom: 0.45rem;
  }
  body.desk-shell.mobile-page-open .fb-desk-widget,
  body.desk-shell.mobile-page-open .fb-desk-widget-btn {
    display: flex;
  }
  body.desk-shell.fb-desk-widget-open .fb-desk-widget-btn {
    display: none;
  }
  body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileTalkDock {
    display: none !important;
  }
}

/* Shop Chat / Desk composer lock — bar stays on screen */
.chatpane,
.chatpane .shop-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chatpane .shop-chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.chatpane .shop-chat-dock,
.chatpane .shop-chat-form,
body.desk-shell .shop-chat-dock,
body.desk-shell .shop-chat-form,
body.desk-shell.dock-collapsed .right-dock .shop-chat-dock,
body.desk-shell.dock-collapsed .right-dock .shop-chat-form {
  display: flex !important;
  flex: 0 0 auto;
}
.shop-chat-camera,
.shop-chat-mic,
.chatpane .shop-chat-camera,
.chatpane .shop-chat-mic,
body.desk-shell .shop-chat-camera,
body.desk-shell .shop-chat-mic {
  display: flex !important;
}
@media (max-width: 860px) {
  body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-dock,
  body.desk-shell .fb-desk-widget-win.open .mobile-desk-dock,
  body.desk-shell.mobile-page-open .fb-desk-widget-win.open .mobile-desk-dock,
  body.desk-shell.fb-desk-widget-open .fb-desk-widget-win #mobileDeskForm,
  body.desk-shell .fb-desk-widget-win.open #mobileDeskForm,
  body.desk-shell.mobile-page-open .fb-desk-widget-win.open #mobileDeskForm {
    display: flex !important;
  }
}


/* —— D1 desktop chrome + one mouth. Do not restyle mobile. Never auto-run D2. —— */
@media (min-width: 861px) {
  body.desk-shell .preview-banner,
  body.desk-shell.is-preview .preview-banner,
  body.desk-shell .preview-banner:not([hidden]),
  body.desk-shell.is-preview .preview-banner[hidden] {
    display: none !important;
  }
  body.desk-shell .sidebar-help,
  body.desk-shell #replayTour { display: none !important; }
  body.desk-shell .sidebar-top { display: none; }
  body.desk-shell .sidebar,
  body.desk-shell .sidebar-nav,
  body.desk-shell .sidebar-foot,
  body.desk-shell .desk-col,
  body.desk-shell .desk {
    overflow-x: hidden;
    max-width: 100%;
  }
  body.desk-shell .sidebar-nav {
    min-width: 0;
  }
  body.desk-shell .nav-sub { display: none !important; }
  body.desk-shell .shop-mark,
  body.desk-shell .desk-topbar-shop,
  body.desk-shell .sidebar-foot .shop-mark {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    flex: 1 1 auto;
  }
  body.desk-shell .desk-topbar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 52px;
    height: auto;
  }
  body.desk-shell .desk-topbar-shop {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
  }
  body.desk-shell .nav-live-filters {
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
    margin: 0 0 0.35rem;
    padding: 0 0 0.15rem 0.35rem;
  }
  body.desk-shell .nav-live-filters a {
    min-height: 34px;
    padding: 0.28rem 0.7rem 0.28rem 1.15rem;
    font-size: 0.86rem;
    font-weight: 500;
  }
  body.desk-shell .nav-more {
    margin-top: 0.2rem;
  }
  body.desk-shell .nav-more summary {
    list-style: none;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell .nav-more summary::-webkit-details-marker { display: none; }
  body.desk-shell .nav-more summary:hover,
  body.desk-shell .nav-more summary:focus-visible {
    background: var(--fb-info-bg, #DBEAFE);
  }
  body.desk-shell .nav-more[open] summary {
    font-weight: 650;
  }
  body.desk-shell .nav-more a {
    padding-left: 1.15rem;
    font-size: 0.86rem;
  }
  body.desk-shell #urgentCount:empty,
  body.desk-shell #urgentCount:is([hidden]) { display: none; }
  body.desk-shell #urgentCount {
    display: inline-block;
    min-width: 1.1em;
    margin-left: 0.35rem;
    font-weight: 700;
  }

  /* Two columns of one app: light desk + light talk, or dark + dark */
  body.desk-shell .chatpane,
  body.desk-shell .chatpane .shop-chat,
  body.desk-shell .chatpane .shop-chat-thread,
  body.desk-shell .chatpane .shop-chat-log,
  body.desk-shell .live-chat-rail {
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
    box-shadow: none;
  }
  body.desk-shell .live-chat-rail {
    box-shadow: inset 0 0 0 1px var(--fb-line, rgba(243,238,228,.12));
  }
  body.desk-shell .chatpane {
    border-left: 1px solid var(--fb-line, rgba(243,238,228,.12));
    box-shadow: none;
  }
  body.desk-shell .chatpane .shop-chat-head {
    background: var(--fb-bg-2, #0B1220);
    border-bottom: 1px solid var(--fb-line, rgba(243,238,228,.12));
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell .chatpane .shop-chat-head h1,
  body.desk-shell .chatpane .shop-chat-head .sub {
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell .chatpane .shop-chat-head .sub { color: var(--fb-muted, #9AA3B2); }
  body.desk-shell .chatpane .shop-chat-dock,
  body.desk-shell .chatpane .shop-chat-form,
  body.desk-shell .chatpane .shop-chat-hints {
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
    border-color: var(--fb-line, rgba(243,238,228,.12));
  }
  body.desk-shell .chatpane .shop-chat-form {
    border-top: 1px solid var(--fb-line, rgba(243,238,228,.12));
    align-items: center;
    gap: 0.4rem;
  }
  body.desk-shell .chatpane .shop-chat-form textarea {
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
    border-color: var(--fb-line, rgba(243,238,228,.12));
  }
  body.desk-shell .chatpane .shop-chat-form textarea::placeholder { color: var(--fb-muted, #9AA3B2); }
  body.desk-shell .chatpane .shop-chat-form textarea:focus {
    border-color: var(--fb-primary, #2B7FFF);
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
  }
  body.desk-shell .chatpane .shop-chat-attach,
  body.desk-shell .chatpane .shop-chat-camera,
  body.desk-shell .chatpane .shop-chat-mic,
  body.desk-shell .chatpane .shop-chat-send {
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
  }
  body.desk-shell .chatpane .shop-chat-bubble.assistant {
    background: #0A0A0A;
    color: #050505;
  }
  body.desk-shell .chatpane .shop-chat-bubble.user {
    background: var(--fb-primary, #2B7FFF);
    color: #FFFFFF;
  }
  body.desk-shell .chatpane .shop-chat-bubble.system { color: var(--fb-muted, #9AA3B2); }
  body.desk-shell .shop-chat-avatar,
  body.desk-shell .chatpane .shop-chat-avatar { display: none !important; }
  body.desk-shell .shop-chat-log,
  body.desk-shell .shop-chat-thread {
    background-image: none !important;
  }
  body.desk-shell .owl-watermark,
  body.desk-shell .shop-chat-watermark { display: none !important; }
  body.desk-shell .shop-chat-actions {
    margin: 0 0.8rem 0.25rem;
  }
  body.desk-shell .shop-chat-actions summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--fb-ink, #F3EEE4);
    padding: 0.25rem 0;
  }
  body.desk-shell .shop-chat-actions summary::-webkit-details-marker { display: none; }
  body.desk-shell .shop-chat-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.2rem 0 0.35rem;
  }
  body.desk-shell .shop-chat-actions-list button {
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    background: var(--fb-bg, #070B12);
    color: var(--fb-ink, #F3EEE4);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    cursor: pointer;
  }
  body.desk-shell .shop-chat-attach-label { display: none; }
  body.desk-shell .shop-chat-plane {
    width: 18px;
    height: 18px;
    display: block;
  }
  body.desk-shell .live-bin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
  }
  body.desk-shell .live-bin-filters a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.28rem 0.7rem;
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 999px;
    background: var(--fb-bg-2, #0B1220);
    color: var(--fb-ink, #F3EEE4);
    font-size: 0.82rem;
    font-weight: 600;
  }
  body.desk-shell .live-bin-filters a:hover,
  body.desk-shell .live-bin-filters a.on {
    border-color: var(--fb-primary, #2B7FFF);
    background: var(--fb-info-bg, #DBEAFE);
  }
  body.desk-shell .settings-preview-note {
    margin: 0.45rem 0 0;
    color: var(--fb-muted, #9AA3B2);
    font-size: 0.88rem;
  }
  body.desk-shell .desk {
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  }
}


/* —— D2 desktop Live + chat cards. Do not restyle mobile. Never auto-run M1. —— */
@media (min-width: 861px) {
  body.desk-shell .live-desk .board-urgent { display: none !important; }
  body.desk-shell .live-job-card .name { font-weight: 700; }
  body.desk-shell .live-job-card .meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; color: var(--fb-muted, #9AA3B2); }
  body.desk-shell .live-job-card .live-event { font-size: 0.8rem; color: var(--fb-muted, #9AA3B2); }
  body.desk-shell .live-book-empty-body { padding: 0.8rem 0.2rem 1rem; }
  body.desk-shell .live-book-empty-body p { margin: 0 0 0.7rem; }
  body.desk-shell .d2-fail-card,
  body.desk-shell .d2-confirm-card {
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    background: var(--fb-bg-2, #0B1220);
  }
  body.desk-shell .d2-fail-title,
  body.desk-shell .d2-confirm-title { font-weight: 700; margin-bottom: 0.35rem; }
  body.desk-shell .d2-fail-why { margin: 0 0 0.6rem; color: var(--fb-muted, #9AA3B2); }
  body.desk-shell .d2-confirm-card label { display: block; margin: 0.35rem 0; font-size: 0.86rem; }
  body.desk-shell .d2-confirm-card input {
    display: block;
    width: 100%;
    margin-top: 0.15rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--fb-line, rgba(243,238,228,.12));
    border-radius: 8px;
  }
  body.desk-shell .d2-confirm-err { color: #B91C1C; font-size: 0.84rem; }
}

/* —— M1 mobile home + tabs. Do not restyle desktop. Never auto-run M2. —— */
@media (max-width: 860px) {
  body.desk-shell .preview-banner,
  body.desk-shell.is-preview .preview-banner,
  body.desk-shell .preview-banner:not([hidden]),
  body.desk-shell.is-preview .preview-banner[hidden] {
    display: none !important;
  }
  body.desk-shell .mobile-command,
  body.desk-shell .chat-fab,
  body.desk-shell #chatFab {
    display: none !important;
  }
  body.desk-shell .fb-desk-widget,
  body.desk-shell #fbDeskWidget {
    display: block !important;
  }
  body.desk-shell .fb-desk-widget-btn,
  body.desk-shell #fbDeskWidgetBtn {
    display: flex !important;
  }
  body.desk-shell.fb-desk-widget-open .fb-desk-widget-btn,
  body.desk-shell.fb-desk-widget-open #fbDeskWidgetBtn {
    display: none !important;
  }
  body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileTalkDock,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) .mobile-desk-dock {
    display: none !important;
  }
  body.desk-shell.crew-mode .mobile-bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.desk-shell .mobile-desk-head.mobile-talk-head {
    background: var(--fb-bg, #000000);
    color: var(--fb-ink, #E8E8E8);
    min-height: 48px;
    padding: calc(0.35rem + var(--fb-safe-top, 0px)) 0.85rem 0.35rem;
    border-bottom: 1px solid var(--fb-line, #E2E8F0);
  }
  body.desk-shell .mobile-desk-head.mobile-talk-head .mobile-desk-shop {
    font-weight: 800;
    font-size: 1rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.desk-shell .mobile-talk-scroll,
  body.desk-shell #mobileDeskHome {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.65rem 0.75rem 5.5rem;
  }
  body.desk-shell .mobile-desk-dock,
  body.desk-shell #mobileTalkDock {
    display: flex;
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 45;
    padding: 0.4rem 0.55rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    background: var(--fb-bg-2, #0B1220);
    border-top: 1px solid var(--fb-line, #E2E8F0);
  }
  body.desk-shell #mobileTalkDock[hidden] { display: none !important; }
  body.desk-shell #mobileTalkDock .mobile-desk-form,
  body.desk-shell #mobileDeskForm {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    width: 100%;
  }
  body.desk-shell #mobileDeskMic.mobile-mic-lg,
  body.desk-shell #mobileDeskMic {
    min-width: 52px;
    min-height: 52px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #0B1F3A;
    color: #fff;
    border: 0;
  }
  body.desk-shell #mobileDeskMic.on { background: #2B7FFF; }
  body.desk-shell .mobile-send-plane {
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #2B7FFF;
    color: #fff;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  body.desk-shell .mobile-send-plane .shop-chat-plane {
    width: 22px;
    height: 22px;
  }
  body.desk-shell .mobile-talk-today,
  body.desk-shell .mobile-talk-urgents,
  body.desk-shell .mobile-talk-threads {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0 0 0.75rem;
  }
  body.desk-shell .mobile-talk-row,
  body.desk-shell .mobile-today-page .mobile-talk-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    min-height: 52px;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--fb-line, #E2E8F0);
    border-radius: 12px;
    background: #fff;
    color: var(--fb-ink, #F3EEE4);
    font: inherit;
    text-align: left;
  }
  body.desk-shell .mobile-talk-row b { font-size: 0.98rem; }
  body.desk-shell .mobile-talk-row span { color: var(--fb-muted, #9AA3B2); font-size: 0.84rem; }
  body.desk-shell .mobile-jobs-filters {
    display: flex;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem 0.2rem;
  }
  body.desk-shell .mobile-jobs-filter {
    min-height: 40px;
    padding: 0 0.85rem;
    border: 1px solid var(--fb-line, #E2E8F0);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-weight: 700;
  }
  body.desk-shell .mobile-jobs-filter.on {
    background: #0B1F3A;
    color: #fff;
    border-color: #0B1F3A;
  }
  body.desk-shell .mobile-more-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem;
  }
  body.desk-shell .mobile-more-list a {
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0 0.9rem;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-weight: 650;
  }
  body.desk-shell .mobile-today-page {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem 0.75rem 5.5rem;
  }
}

/* —— M2 mobile cards + Today. Do not restyle desktop. Never auto-run PK1. —— */
@media (max-width: 860px) {
  body.desk-shell .mobile-talk-job {
    position: relative;
    gap: 0.12rem;
  }
  body.desk-shell .mobile-talk-job.is-unread {
    box-shadow: inset 3px 0 0 #2B7FFF;
  }
  body.desk-shell .mobile-talk-unread {
    position: absolute;
    top: 0.85rem;
    right: 0.75rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2B7FFF;
  }
  body.desk-shell .mobile-talk-street,
  body.desk-shell .mobile-talk-need,
  body.desk-shell .mobile-talk-last,
  body.desk-shell .mobile-talk-time {
    color: var(--fb-muted, #9AA3B2);
    font-size: 0.82rem;
  }
  body.desk-shell .mobile-talk-time { font-variant-numeric: tabular-nums; }
  body.desk-shell .mobile-today-job {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0 0 0.7rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--fb-line, #E2E8F0);
    border-radius: 12px;
    background: #fff;
  }
  body.desk-shell .mobile-today-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
  }
  body.desk-shell .mobile-today-actions .btn { min-height: 44px; }
  body.desk-shell .mobile-today-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  body.desk-shell .mobile-today-empty .status-led-ok,
  body.desk-shell .mobile-today-empty .clear,
  body.desk-shell .mobile-today-empty .empty-clear {
    display: none !important;
  }
  body.desk-shell .m2-photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
}

/* PK1 packet header. Five fields always visible. Never auto-run PK2. */
.pkt-header-truth {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.45rem 0.75rem;
  margin: 0.45rem 0 0.35rem;
}
.pkt-header-truth > div b {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.pkt-header-truth select {
  width: 100%;
  min-height: 36px;
  margin-top: 0.15rem;
}
.pkt-header-stamps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 0.45rem;
}
.pkt-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(11, 31, 58, 0.06);
  font-size: 0.75rem;
  font-weight: 650;
}
.pkt-stamp.pin { color: #0B1F3A; }
.pkt-header-next { min-width: 160px; }


/* PK2 packet workspace tabs. Scoreboard, not a timeline. Never auto-run PK3. */
.pkt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.6rem 0 0.75rem;
}
.pkt-tab {
  border: 1px solid var(--fb-line, #E2E8F0);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  min-height: 36px;
  font-weight: 650;
}
.pkt-tab.is-on {
  background: #0B1F3A;
  color: #fff;
  border-color: #0B1F3A;
}
.pkt-mobile-actions { display: none; }
.pkt-scoreboard {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pkt-next-owner,
.pkt-site-progress,
.pkt-money-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem 0.75rem;
}
.pkt-money-strip > div,
.pkt-next-owner > div,
.pkt-site-progress > div {
  background: #fff;
  border: 1px solid var(--fb-line, #E2E8F0);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}
.pkt-money-strip span,
.pkt-scoreboard b {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.pkt-money-strip.pk2-cost-plus b { color: #0B1F3A; }
.pkt-next3 ol { margin: 0.3rem 0 0 1.1rem; }
.pkt-open-flags { display: flex; flex-direction: column; gap: 0.4rem; }
.pkt-flag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--fb-line, #E2E8F0);
  border-radius: 10px;
}
.pkt-flag.yellow,
.pkt-extra.yellow {
  background: #FFF7D6;
  border-color: #E6C200;
}
.pkt-extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  align-items: end;
}
.pkt-photo-bucket { margin: 0.8rem 0; }
.pkt-photo-camera { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; }
.pkt-tl-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.pkt-office-list { margin: 0; padding-left: 1.1rem; }
.pkt-office-list li span { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 860px) {
  .pkt-mobile-actions { display: block; margin: 0.5rem 0; }
  .pkt-tabs [data-pkt-tab="milestones"] { order: 9; }
  .job-facts { display: none; }
}


.fb-offline-badge {
  position: fixed;
  left: 12px;
  bottom: 84px;
  z-index: 38;
  background: #0B1F3A;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#moneyEmptyCopy { font-size: 1.05rem; }


/* —— RS0 first-run four cards + crew Today —— */
body.first-run-view .composer,
body.first-run-view #topSearch,
body.first-run-view .sidebar { display: none !important; }
.rs0-first-run { max-width: 520px; margin: 2rem auto; padding: 0 1rem 3rem; }
.rs0-first-run h1 { margin: 0 0 .35rem; font-size: 1.45rem; }
.rs0-card { margin: 0 0 1rem; padding: 1rem 1.1rem; border-radius: 12px; border: 1px solid rgba(11,31,58,.12); background: #fff; }
.rs0-card h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.rs0-card .field { margin: 0 0 .55rem; }
.rs0-card label { display: block; font-size: .78rem; font-weight: 650; margin-bottom: .2rem; }
.rs0-card input, .rs0-card select { width: 100%; }
.rs0-invite-card { border: 1px solid rgba(11,31,58,.16); border-radius: 12px; padding: .85rem 1rem; background: #fff; }
.rs0-invite-card .d2-confirm-title { font-weight: 700; margin-bottom: .45rem; }
.rs0-today { padding: 1rem; }
.rs0-today-job { border: 1px solid rgba(11,31,58,.12); border-radius: 12px; padding: 1rem; background: #fff; }
.rs0-today-job h2 { margin: 0 0 .35rem; }
.rs0-today-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
body.crew-today .live-op-command-sec,
body.crew-today #mobileDeskChips,
body.foreman-today .live-op-command-sec { display: none !important; }
.settings-preview-switch { display: flex; align-items: center; gap: .55rem; margin: .4rem 0 .8rem; }


/* —— RD people rail + view-as + partner + today-by —— */
.rd-people-rail { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem; margin:.55rem 0 .2rem; }
.rd-people-faces { display:flex; flex-wrap:wrap; gap:.35rem; }
.rd-face { display:inline-flex; align-items:center; gap:.35rem; border:1px solid rgba(11,31,58,.16); background:#fff; border-radius:999px; padding:.15rem .55rem .15rem .15rem; }
.rd-face-ini { width:1.6rem; height:1.6rem; border-radius:50%; background:#0B1F3A; color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:700; }
.rd-face-name { font-size:.82rem; font-weight:650; }
.rd-people-picker { display:flex; flex-wrap:wrap; gap:.45rem; align-items:end; width:100%; margin-top:.35rem; }
.rd-view-as { display:flex; flex-wrap:wrap; align-items:center; gap:.3rem; font-size:.78rem; margin-left:.5rem; }
.rd-today-by { margin:0 0 .75rem; padding:.55rem .7rem; border:1px solid rgba(11,31,58,.12); border-radius:10px; background:#fff; }
.rd-today-by-row { font-size:.88rem; padding:.15rem 0; }
.rd-partner-slice { padding:1rem; }
.rd-handoff-card, .rd-coi-card { border:1px solid rgba(11,31,58,.16); border-radius:12px; padding:.85rem 1rem; background:#fff; }
body.partner-mode [data-nav-group="settings"],
body.partner-mode [data-nav-group="webchat"] { display:none !important; }
body.partner-mode #chatPane,
body.partner-mode #rightDockRail { display:none !important; }
body.foreman-mode [data-nav-group="money"],
body.foreman-mode #pktMoneyStrip,
body.foreman-mode .pkt-money-strip { display:none !important; }
body.crew-mode #pktMoneyStrip,
body.crew-mode .pkt-money-strip { display:none !important; }


/* RM — on-site presence + foreman jobs. Conversations hide stays. */
.live-on-site {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: #166534;
  font-size: 13px;
}
.live-on-site-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  flex: 0 0 auto;
}
.rm-foreman-jobs { margin-top: 16px; }
.rm-foreman-jobs h2 { font-size: 16px; margin: 0 0 8px; }
.rm-job-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 8px;
  min-height: var(--fb-tap, 52px);
}
.rm-job-row .name { font-weight: 600; }
.rm-job-row .meta { color: var(--muted); font-size: 13px; }


/* SD — settings home six tiles. Conversations hide stays. */
.sd-settings-home { margin: 0 0 16px; }
.sd-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.sd-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  min-height: var(--fb-tap, 52px);
}
.sd-tile strong { font-size: 15px; }
.sd-health { color: var(--muted); font-size: 13px; }
.sd-rule-list { list-style: none; padding: 0; margin: 0; }
.sd-rule { margin: 0 0 10px; }
.sd-rule-meta { display: block; color: var(--muted); font-size: 12px; }
.sd-job-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sd-job-template textarea { width: 100%; min-height: 90px; }
.sd-matrix { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.sd-matrix th, .sd-matrix td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; font-size: 13px; }
.sd-lights { list-style: none; padding: 0; margin: 0; }
.sd-light { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.sd-dot { width: 10px; height: 10px; border-radius: 50%; background: #ca8a04; flex: 0 0 auto; }
.sd-light-connected .sd-dot { background: #16a34a; }
.sd-light-missing .sd-dot { background: #ca8a04; }
.sd-light-broken .sd-dot { background: #dc2626; }
.sd-last-error { color: #b91c1c; font-size: 12px; }
.settings-preview-switch { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }

/* SM — mobile pocket settings. Conversations hide stays. */
.sm-pocket { max-width: 520px; margin: 0 auto; padding: 12px 16px 80px; }
.sm-pocket h1 { margin: 0 0 .35rem; font-size: 1.35rem; }
.sm-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; }
.sm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: var(--fb-tap, 52px);
  color: inherit;
  text-decoration: none;
}
.sm-meta { color: var(--muted); font-size: 13px; }
.sm-notify, .sm-brand-switch { margin: 16px 0; }
.sm-toggle { display: flex; align-items: center; gap: 10px; min-height: var(--fb-tap, 52px); }
.sm-toggle-list { margin: 8px 0; padding-left: 1.2rem; color: var(--muted); }
.sm-phone-first-run { max-width: 520px; margin: 2rem auto; padding: 0 1rem 3rem; }
.sm-phone-first-run h1 { margin: 0 0 .35rem; font-size: 1.45rem; }
.sm-brand-taps { display: flex; flex-wrap: wrap; gap: 8px; }

/* v350: Conversations never paints Shop Chat / Talk dock. Widget is the only opener. */
body.desk-shell.conv-view:not(.fb-desk-widget-open) #chatPane,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .chatpane,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #rightDockRail,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .live-chat-rail,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .shop-chat,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #shopChat,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #shopChatForm,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileDesk,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileTalkDock,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .mobile-desk-dock,
body.desk-shell.conv-view.live-split:not(.fb-desk-widget-open) #chatPane,
body.desk-shell.conv-view.live-split:not(.fb-desk-widget-open) .chatpane,
body.desk-shell.conv-view.chat-view:not(.fb-desk-widget-open) #chatPane,
body.desk-shell.conv-view.chat-view:not(.fb-desk-widget-open) .chatpane {
  display: none !important;
}
body.desk-shell.conv-view .desk,
body.desk-shell.conv-view.live-split .desk,
body.desk-shell.conv-view.chat-view .desk {
  display: block !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
body.desk-shell.conv-view .thread-wrap .imsg-list-col,
body.desk-shell.conv-view .imsg-one .imsg-list-col { display: none !important; }
body.desk-shell.conv-view .imsg-inbox:not(.thread-wrap):not(.imsg-one) .imsg-list-col {
  display: flex !important;
}

@media (min-width: 861px) {
  body.desk-shell.conv-view .fb-desk-widget,
  body.desk-shell.conv-view #fbDeskWidget {
    display: block !important;
  }
  body.desk-shell.conv-view .fb-desk-widget-btn,
  body.desk-shell.conv-view #fbDeskWidgetBtn {
    display: flex !important;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 80;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: #0B1F3A;
    box-shadow: 0 8px 24px rgba(11,31,58,.28);
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
  }
  body.desk-shell.conv-view.fb-desk-widget-open .fb-desk-widget-btn,
  body.desk-shell.conv-view.fb-desk-widget-open #fbDeskWidgetBtn {
    display: none !important;
  }
  body.desk-shell.conv-view .fb-desk-widget-win {
    position: fixed;
    right: 20px;
    bottom: 84px;
    left: auto;
    z-index: 81;
    width: min(420px, calc(100vw - 40px));
    height: min(640px, calc(100vh - 120px));
    background: var(--bg);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(11,31,58,.22);
    border: 1px solid rgba(11,31,58,.08);
    display: none;
    flex-direction: column;
    overflow: hidden;
  }
  body.desk-shell.conv-view .fb-desk-widget-win.open,
  body.desk-shell.conv-view.fb-desk-widget-open .fb-desk-widget-win {
    display: flex !important;
  }
  body.desk-shell.conv-view .fb-desk-widget-head {
    background: #0B1F3A;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
  }
  body.desk-shell.conv-view .fb-desk-widget-head img {
    height: 28px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
  }
  body.desk-shell.conv-view #fbDeskWidgetClose {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
  }
  body.desk-shell.conv-view.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-dock,
  body.desk-shell.conv-view .fb-desk-widget-win.open .mobile-desk-dock,
  body.desk-shell.conv-view.fb-desk-widget-open .fb-desk-widget-win #mobileDeskForm {
    display: flex !important;
  }
  body.desk-shell.conv-view.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-thread {
    display: block !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }
}

/* v351: Shop Chat chips sit ABOVE the composer and ABOVE the bottom barrier.
   Covering culprits: .fb-desk-widget-win overflow:hidden + chips flex-shrink;
   #mobileTalkDock position:sticky; z-index:45; safe-area padding (ID wins);
   icons.css mobile-page-open { display:none } on .mobile-desk-chips;
   .chatpane overflow:hidden clipping .shop-chat-actions when opened. */
body.desk-shell .shop-chat-dock,
.chatpane .shop-chat-dock {
  flex: 0 0 auto;
  overflow: visible;
}
body.desk-shell .shop-chat-actions,
.chatpane .shop-chat-actions,
body.desk-shell .shop-chat-actions-list,
.chatpane .shop-chat-actions-list,
body.desk-shell .shop-chat-hints,
.chatpane .shop-chat-hints,
body.desk-shell .mobile-desk-chips,
body.desk-shell #mobileDeskChips {
  flex: 0 0 auto;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  overflow: visible;
}
body.desk-shell:not(.conv-view) .shop-chat-actions-list,
body.desk-shell:not(.conv-view) .chatpane .shop-chat-actions-list,
body.desk-shell:not(.conv-view) .shop-chat-hints,
body.desk-shell:not(.conv-view) .chatpane .shop-chat-hints,
body.desk-shell.conv-view.fb-desk-widget-open .shop-chat-actions-list,
body.desk-shell.conv-view.fb-desk-widget-open .shop-chat-hints,
body.desk-shell.fb-desk-widget-open .chatpane .shop-chat-actions-list,
body.desk-shell.fb-desk-widget-open .chatpane .shop-chat-hints {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem 0.45rem;
}
body.desk-shell .shop-chat-form,
.chatpane .shop-chat-form {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

/* Widget panel: thread scrolls; chips + composer stay inside, above nav. */
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win,
body.desk-shell .fb-desk-widget-win.open {
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-thread,
body.desk-shell .fb-desk-widget-win.open .mobile-desk-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-chips,
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win #mobileDeskChips,
body.desk-shell.mobile-page-open.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-chips,
body.desk-shell.mobile-page-open.fb-desk-widget-open .fb-desk-widget-win #mobileDeskChips,
body.desk-shell .fb-desk-widget-win.open .mobile-desk-chips,
body.desk-shell .fb-desk-widget-win.open #mobileDeskChips {
  display: flex !important;
  flex: 0 0 auto;
  flex-shrink: 0;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--fb-tap, 52px);
  padding: 0.4rem 0.65rem 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  position: relative;
  z-index: 3;
}
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-chip,
body.desk-shell .fb-desk-widget-win.open .mobile-desk-chip {
  flex: 0 0 auto;
  min-height: var(--fb-tap, 52px);
  white-space: nowrap;
}
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win #mobileTalkDock,
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-dock,
body.desk-shell .fb-desk-widget-win.open #mobileTalkDock,
body.desk-shell .fb-desk-widget-win.open .mobile-desk-dock,
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win #mobileDeskForm,
body.desk-shell .fb-desk-widget-win.open #mobileDeskForm {
  display: flex !important;
  flex: 0 0 auto;
  flex-shrink: 0;
  position: relative !important;
  bottom: auto !important;
  z-index: 3;
  padding-bottom: 0.5rem !important;
}

@media (max-width: 860px) {
  /* Open widget sits on the nav, not 76px above it (FAB is hidden). */
  body.desk-shell.fb-desk-widget-open .fb-desk-widget-win,
  body.desk-shell .fb-desk-widget-win.open {
    bottom: 0;
    height: 100dvh;
    max-height: none;
  }
}

/* v353: Conversations is one pane. Inbox = people list only. Thread = that convo only. Shop Chat only from widget. */
body.conv-view:not(.fb-desk-widget-open) #chatPane,
body.conv-view:not(.fb-desk-widget-open) .chatpane,
body.conv-view:not(.fb-desk-widget-open) #rightDockRail,
body.conv-view:not(.fb-desk-widget-open) #shopChat,
body.conv-view:not(.fb-desk-widget-open) #shopChatForm,
body.conv-view:not(.fb-desk-widget-open) .shop-chat,
body.conv-view:not(.fb-desk-widget-open) .shop-chat-actions,
body.conv-view:not(.fb-desk-widget-open) .shop-chat-hints,
body.conv-view:not(.fb-desk-widget-open) #mobileDesk,
body.conv-view:not(.fb-desk-widget-open) #mobileTalkDock,
body.conv-view:not(.fb-desk-widget-open) .mobile-desk-dock,
body.conv-view:not(.fb-desk-widget-open) .mobile-desk-chips {
  display: none !important;
}
.imsg-thread-empty { display: none !important; }
body.conv-view .imsg-inbox:not(.thread-wrap):not(.imsg-one) .imsg-list-col {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  max-width: none;
}
body.conv-view .imsg-one .imsg-thread-only,
body.conv-view .thread-wrap .imsg-thread-only {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

/* v354: Mobile Jobs cards grow; no overlap. Leads / Service / Open only. Do not restyle Conversations. */
@media (max-width: 860px) {
  body.desk-shell #mobilePaneJobs {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  body.desk-shell #mobilePaneJobs .mobile-jobs-filters {
    flex: 0 0 auto;
  }
  body.desk-shell #mobilePaneJobs .mobile-glance,
  body.desk-shell #mobilePaneJobs .mobile-jobs-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 0.75rem 0.75rem 5.5rem;
  }
  body.desk-shell #mobilePaneJobs .live-row,
  body.desk-shell #mobilePaneJobs .list-row,
  body.desk-shell #mobilePaneJobs .live-job-card,
  body.desk-shell #mobilePaneJobs .mobile-talk-row {
    flex: 0 0 auto;
    flex-shrink: 0;
    height: auto;
    min-height: min-content;
    overflow: visible;
    position: relative;
    align-items: flex-start;
    align-self: stretch;
  }
  body.desk-shell #mobilePaneJobs .live-job-card .name,
  body.desk-shell #mobilePaneJobs .live-job-card .meta,
  body.desk-shell #mobilePaneJobs .live-job-card .live-when {
    overflow: visible;
    white-space: normal;
  }
  body.desk-shell #mobilePaneJobs .live-job-card .live-event {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    white-space: normal;
  }
}

/* v355: JUST HIDE CHAT on conv-view. Widget is the only opener. Kill the owl rail. */
body.desk-shell.conv-view:not(.fb-desk-widget-open) #chatPane,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .chatpane,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #rightDockRail,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .live-chat-rail,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .live-chat-rail-logo,
body.desk-shell.conv-view:not(.fb-desk-widget-open) img.live-chat-rail-logo,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #shopChat,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #shopChatForm,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .shop-chat,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .shop-chat-actions,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .shop-chat-hints,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileDesk,
body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileTalkDock,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .mobile-desk-dock,
body.desk-shell.conv-view:not(.fb-desk-widget-open) .mobile-desk-chips {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.desk-shell.conv-view .desk,
body.desk-shell.conv-view.live-split .desk,
body.desk-shell.conv-view.chat-view .desk {
  display: block !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
@media (min-width: 861px) {
  body.desk-shell.conv-view:not(.fb-desk-widget-open) #chatPane,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) .chatpane,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) #rightDockRail,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) .live-chat-rail,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) .live-chat-rail-logo,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) img.live-chat-rail-logo,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) #shopChat,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileDesk,
  body.desk-shell.conv-view:not(.fb-desk-widget-open) #mobileTalkDock {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
  }
  body.desk-shell.conv-view .desk,
  body.desk-shell.conv-view.live-split .desk,
  body.desk-shell.conv-view.chat-view .desk,
  body.desk-shell.conv-view .desk.live-split {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }
}

/* v356: Widget is the only chat. Kill leftover thread + Tell FIELDBOT dock on every page. */
body.desk-shell:not(.fb-desk-widget-open) #mobileTalkDock,
body.desk-shell:not(.fb-desk-widget-open) .mobile-desk-dock,
body.desk-shell:not(.fb-desk-widget-open) #mobileDeskForm,
body.desk-shell:not(.fb-desk-widget-open) .mobile-desk-form,
body.desk-shell:not(.fb-desk-widget-open) #mobileDeskThread,
body.desk-shell:not(.fb-desk-widget-open) .mobile-desk-thread,
body.desk-shell:not(.fb-desk-widget-open) #mobileDeskChips,
body.desk-shell:not(.fb-desk-widget-open) .mobile-desk-chips {
  display: none !important;
  width: auto !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
@media (max-width: 860px) {
  body.desk-shell:not(.fb-desk-widget-open) #mobileTalkDock,
  body.desk-shell:not(.fb-desk-widget-open) .mobile-desk-dock,
  body.desk-shell:not(.fb-desk-widget-open) #mobileDeskForm,
  body.desk-shell:not(.fb-desk-widget-open) #mobileDeskThread,
  body.desk-shell:not(.fb-desk-widget-open) .mobile-desk-thread {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win #mobileTalkDock,
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-dock,
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win #mobileDeskForm,
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-form {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden;
}
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win #mobileDeskThread,
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-thread {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.fb-desk-widget-win {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
#mobileDeskThread,
.mobile-desk-thread {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.fb-desk-widget-win .shop-chat-form,
.fb-desk-widget-win #shopChatForm,
.fb-desk-widget-win .mobile-desk-composer {
  flex: 0 0 auto;
}

.action-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-card-actions button {
  min-height: 44px;
  width: 100%;
}

/* v357: Kill giant owl rail. Rail is never the widget. Higher than every D1 rail rule.
   conv-view is one pane. Shop Chat stays widget-only. Hard-cap the logo so it
   can NEVER become a full-page owl even if display slips. Restore Delete. */
.live-chat-rail-logo,
img.live-chat-rail-logo,
#rightDockRail img.live-chat-rail-logo,
body.desk-shell .live-chat-rail-logo,
body.desk-shell.live-split .live-chat-rail-logo {
  max-height: 36px !important;
  max-width: 80px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
body.desk-shell.conv-view #rightDockRail,
body.desk-shell.conv-view .live-chat-rail,
body.desk-shell.conv-view .live-chat-rail-logo,
body.desk-shell.conv-view img.live-chat-rail-logo,
body.desk-shell.conv-view.live-split #rightDockRail,
body.desk-shell.conv-view.live-split .live-chat-rail,
body.desk-shell.conv-view.live-split .live-chat-rail-logo,
body.desk-shell.conv-view.chat-view #rightDockRail,
body.desk-shell.conv-view.fb-desk-widget-open #rightDockRail,
body.desk-shell.conv-view.fb-desk-widget-open .live-chat-rail,
body.desk-shell.conv-view.fb-desk-widget-open .live-chat-rail-logo,
body.desk-shell.conv-view.fb-desk-widget-open img.live-chat-rail-logo,
.desk:has(#chatPane[hidden]) #rightDockRail,
.desk:has(#chatPane[hidden]) .live-chat-rail,
.desk:has(#chatPane[hidden]) .live-chat-rail-logo,
.desk:has(#chatPane[style*="display: none"]) #rightDockRail,
.desk:has(#chatPane[style*="display: none"]) .live-chat-rail,
.desk:has(#chatPane[style*="display: none"]) .live-chat-rail-logo {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
@media (min-width: 861px) {
  body.desk-shell.conv-view #rightDockRail,
  body.desk-shell.conv-view .live-chat-rail,
  body.desk-shell.conv-view .live-chat-rail-logo,
  body.desk-shell.conv-view img.live-chat-rail-logo,
  body.desk-shell.conv-view.live-split #rightDockRail,
  body.desk-shell.conv-view.live-split .live-chat-rail,
  body.desk-shell.conv-view.live-split .live-chat-rail-logo,
  body.desk-shell.conv-view.fb-desk-widget-open #rightDockRail,
  body.desk-shell.conv-view.fb-desk-widget-open .live-chat-rail,
  body.desk-shell.conv-view.fb-desk-widget-open .live-chat-rail-logo,
  body.desk-shell.conv-view.fb-desk-widget-open img.live-chat-rail-logo,
  .desk:has(#chatPane[hidden]) #rightDockRail,
  .desk:has(#chatPane[hidden]) .live-chat-rail,
  .desk:has(#chatPane[hidden]) .live-chat-rail-logo {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body.desk-shell.conv-view .desk,
  body.desk-shell.conv-view.live-split .desk,
  body.desk-shell.conv-view.chat-view .desk {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }
}
/* v357: Delete buttons must stay visible. Owl / overflow hid them. */
body.desk-shell .imsg-row,
body.desk-shell.conv-view .imsg-row,
body.desk-shell .pkt.list-row,
body.desk-shell .list-row {
  overflow: visible !important;
}
body.desk-shell .imsg-row-act,
body.desk-shell.conv-view .imsg-row-act,
body.desk-shell .imsg-del,
body.desk-shell.conv-view .imsg-del,
body.desk-shell .pkt-row-act,
body.desk-shell .pkt-del,
body.desk-shell .row-acts {
  display: flex !important;
  visibility: visible !important;
  overflow: visible !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  flex: 0 0 auto;
  align-items: center;
  z-index: 4;
  position: relative;
}

/* v359: Mobile thread X → Conversations inbox. Not covered by navy widget / bottom nav. */
/* v361: X on EVERY thread — mobile and desktop. Never display:none. Not behind a media query. */
.imsg-head {
  position: relative;
  padding-right: 3.25rem;
}
.imsg-close {
  display: flex;
  position: absolute;
  top: 0.2rem;
  right: 0;
  z-index: 14;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  color: #0F172A;
  font-size: 1.75rem;
  line-height: 1;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
}

/* v360: Lead list is the scroller. One list, not a trapped overlay.
   Dead-scroll cause: overflow:hidden on #app / #mobilePaneJobs / .desk while a
   sibling (.mainpane or leftover #mobileDesk) owned overflow:auto. Visible
   cards sat in the hidden pane; the scrollbar moved the empty one.
   Double-page cause: ensureStageSplit left .stage-list + .stage-detail under
   packet HTML, and #mobileDesk (position:fixed) stayed on top of #app. */
body.desk-shell .mainpane:has(#app > .pkt-list),
body.desk-shell .mainpane:has(#app > .stage-list),
body.desk-shell .mainpane:has(#app.stage-md) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
body.desk-shell #app.main-stage:has(> .pkt-list),
body.desk-shell #app.main-stage:has(> .stage-list),
body.desk-shell #app.main-stage.stage-md {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: hidden;
}
body.desk-shell #app.main-stage > .page-head {
  flex: 0 0 auto;
}
body.desk-shell #app.main-stage > .stage-list,
body.desk-shell #app.main-stage > .pkt-list {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.desk-shell #app.main-stage > .stage-list > .pkt-list {
  overflow: visible;
  height: auto;
  min-height: 0;
}
body.desk-shell #app.main-stage > .stage-detail {
  flex: 0 0 auto;
}

/* Packet replaces the list. No stacked stage panes. No leftover Talk overlay. */
body.desk-shell.pkt-view .mainpane,
body.desk-shell.pkt-view #app.main-stage,
body.desk-shell.pkt-view .mainpane-body {
  display: block;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.desk-shell.pkt-view #app > .stage-list,
body.desk-shell.pkt-view #app > .stage-detail,
body.desk-shell.pkt-view .stage-list,
body.desk-shell.pkt-view .stage-detail {
  display: none !important;
}
body.desk-shell.pkt-view:not(.fb-desk-widget-open) #mobileDesk,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) .mobile-desk,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) #mobileTalkDock,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) .mobile-desk-dock,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) #mobileDeskThread,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) .mobile-desk-thread {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 860px) {
  body.desk-shell.mobile-page-open .mainpane:has(#app > .pkt-list),
  body.desk-shell.mobile-page-open .mainpane:has(#app > .stage-list) {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
    min-height: 0;
    height: 100%;
  }
  body.desk-shell.mobile-page-open #app.main-stage:has(> .pkt-list),
  body.desk-shell.mobile-page-open #app.main-stage:has(> .stage-list) {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
    min-height: 0;
    height: auto;
    flex: 1 1 auto;
  }
  body.desk-shell.pkt-view.mobile-page-open .mainpane,
  body.desk-shell.pkt-view.mobile-page-open #app,
  body.desk-shell.pkt-view.mobile-page-open .main-stage {
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    min-height: 0;
    height: 100%;
  }
  /* Jobs tab: visible list is the scroller; #app underneath must not steal the bar. */
  body.desk-shell.mobile-tab-jobs:not(.mobile-page-open):not(.pkt-view) .mainpane,
  body.desk-shell.mobile-tab-jobs:not(.mobile-page-open):not(.pkt-view) #app,
  body.desk-shell.mobile-tab-jobs:not(.mobile-page-open):not(.pkt-view) .main-stage {
    overflow: hidden !important;
  }
  body.desk-shell #mobilePaneJobs {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }
  body.desk-shell #mobilePaneJobs .mobile-jobs-list,
  body.desk-shell #mobilePaneJobs .mobile-glance {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* v363: Conversations never keeps a rail node. CSS hide already failed.
   JS removeConversationsOwlRail() deletes #rightDockRail / img.live-chat-rail-logo.
   Kill leftover owl paint on the inbox so Delete stays visible. */
body.desk-shell.conv-view .owl-watermark,
body.desk-shell.conv-view .shop-chat-watermark,
body.desk-shell.conv-view .live-chat-rail,
body.desk-shell.conv-view #rightDockRail,
body.desk-shell.conv-view img.live-chat-rail-logo,
body.desk-shell.conv-view .live-chat-rail-logo {
  display: none !important;
}
body.desk-shell.conv-view .imsg-inbox,
body.desk-shell.conv-view .imsg-list,
body.desk-shell.conv-view .imsg-list-col,
body.desk-shell.conv-view .conv-wrap,
body.desk-shell.conv-view .home-wrap.conv-wrap,
body.desk-shell.conv-view .imsg-thread,
body.desk-shell.conv-view .imsg-thread-scroll,
body.desk-shell.conv-view .shop-chat-log,
body.desk-shell.conv-view .shop-chat-thread {
  background-image: none !important;
}
body.desk-shell.conv-view .owl-watermark,
body.desk-shell.conv-view .shop-chat-watermark {
  display: none !important;
}

/* v364: Hard-cap the 1229×1428 / 1.4MB fieldbot-logo.png. Native size is the bird.
   owner-sticky-logo is already capped — leave it. Sidebar mark stays ≤40px. */
body.desk-shell img[src*="fieldbot-logo"]:not(.owner-sticky-logo) {
  max-width: 56px !important;
  max-height: 56px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
body.desk-shell #fbDeskWidgetBtn,
body.desk-shell .fb-desk-widget-btn {
  overflow: hidden !important;
}
body.desk-shell #fbDeskWidgetBtn img,
body.desk-shell .fb-desk-widget-btn img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain !important;
}
body.desk-shell .sidebar .fieldbot-mark-sm,
body.desk-shell .fieldbot-mark-sm {
  max-width: 40px !important;
  max-height: 40px !important;
}


/* v365: Packet is ONE page. Keep the current #app > .jobfile (including its
   .jobfile-head). Kill leftover list chrome sitting on/under it: stage panes,
   renderBin .page-head, leftover cards, #mobilePaneJobs, leftover Talk desk.
   Header is THIS packet only — solid, top:0, nothing scrolls through it. */
body.desk-shell.pkt-view .owner-sticky,
body.desk-shell.pkt-view .top-chrome,
body.desk-shell.pkt-view .page-head,
body.desk-shell.pkt-view .stage-list,
body.desk-shell.pkt-view .stage-detail,
body.desk-shell.pkt-view #stageDetail,
body.desk-shell.pkt-view #mobilePaneJobs,
body.desk-shell.pkt-view #mobilePaneTalk,
body.desk-shell.pkt-view #mobilePaneToday,
body.desk-shell.pkt-view #mobilePaneMore,
body.desk-shell.pkt-view .mobile-jobs-list,
body.desk-shell.pkt-view .mobile-jobs-filters,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) #mobileDesk,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) .mobile-desk,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) #mobileTalkDock,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) .mobile-desk-dock,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) #mobileDeskThread,
body.desk-shell.pkt-view:not(.fb-desk-widget-open) .mobile-desk-thread {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.desk-shell.pkt-view .mainpane {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  height: 100% !important;
  min-height: 0 !important;
}
body.desk-shell.pkt-view #app,
body.desk-shell.pkt-view #app.main-stage,
body.desk-shell.pkt-view .mainpane-body {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #FFFFFF;
}
body.desk-shell.pkt-view .jobfile {
  position: relative;
  z-index: 1;
  background: #FFFFFF;
}
body.desk-shell.pkt-view .jobfile-head,
body.desk-shell.pkt-view .pkt-header,
body.desk-shell.pkt-view .jobfile > .jobfile-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 8 !important;
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
}

/* v365: logo stays capped. Do not restore an uncapped fieldbot-logo. */
body.desk-shell img[src*="fieldbot-logo"]:not(.owner-sticky-logo) {
  max-width: 56px !important;
  max-height: 56px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
body.desk-shell #fbDeskWidgetBtn img,
body.desk-shell .fb-desk-widget-btn img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain !important;
}


/* v366: Desktop Conversations keeps Shop Chat as the locked RIGHT #chatPane.
   JS isDesktopDesk() / .desk-desktop is the gate — not a media-query-only hide.
   #rightDockRail / owl stay dead. Logo stays capped. Mobile widget-only. */
body.desk-shell.desk-desktop.live-split .desk,
body.desk-shell.desk-desktop.conv-view.live-split .desk,
body.desk-shell.desk-desktop.conv-view.live-split.chat-view .desk {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}
body.desk-shell.desk-desktop.live-split #chatPane,
body.desk-shell.desk-desktop.live-split .chatpane,
body.desk-shell.desk-desktop.conv-view.live-split #chatPane,
body.desk-shell.desk-desktop.conv-view.live-split .chatpane,
body.desk-shell.desk-desktop.conv-view.live-split:not(.fb-desk-widget-open) #chatPane,
body.desk-shell.desk-desktop.conv-view.live-split:not(.fb-desk-widget-open) .chatpane,
body.desk-shell.desk-desktop.conv-view.live-split #chatPane #shopChat,
body.desk-shell.desk-desktop.conv-view.live-split #chatPane .shop-chat,
body.desk-shell.desk-desktop.conv-view.live-split #chatPane #shopChatForm,
body.desk-shell.desk-desktop.conv-view.live-split:not(.fb-desk-widget-open) #chatPane #shopChat,
body.desk-shell.desk-desktop.conv-view.live-split:not(.fb-desk-widget-open) #chatPane .shop-chat,
body.desk-shell.desk-desktop.conv-view.live-split:not(.fb-desk-widget-open) #chatPane #shopChatForm {
  display: flex !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  overflow: hidden !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
body.desk-shell.desk-desktop.conv-view.live-split #chatPane .shop-chat-actions-list,
body.desk-shell.desk-desktop.conv-view.live-split #chatPane .shop-chat-hints,
body.desk-shell.desk-desktop.conv-view.live-split #chatPane .shop-chat-actions,
body.desk-shell.desk-desktop.conv-view.live-split:not(.fb-desk-widget-open) #chatPane .shop-chat-actions-list,
body.desk-shell.desk-desktop.conv-view.live-split:not(.fb-desk-widget-open) #chatPane .shop-chat-hints {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  overflow: visible !important;
}
body.desk-shell #rightDockRail,
body.desk-shell .live-chat-rail,
body.desk-shell.live-split #rightDockRail,
body.desk-shell.conv-view #rightDockRail,
body.desk-shell.conv-view.live-split #rightDockRail,
body.desk-shell.desk-desktop #rightDockRail,
body.desk-shell.desk-desktop.live-split #rightDockRail,
body.desk-shell.desk-desktop.conv-view #rightDockRail,
body.desk-shell.desk-desktop.conv-view.live-split #rightDockRail {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.desk-shell.desk-mobile.conv-view:not(.fb-desk-widget-open) #chatPane,
body.desk-shell.desk-mobile.conv-view:not(.fb-desk-widget-open) .chatpane,
body.desk-shell.desk-mobile.conv-view:not(.fb-desk-widget-open) #shopChat,
body.desk-shell.desk-mobile.conv-view:not(.fb-desk-widget-open) #shopChatForm {
  display: none !important;
}
/* v366: leftover Talk / Tell FIELDBOT dock stays widget-only on mobile. */
body.desk-shell.desk-mobile.conv-view:not(.fb-desk-widget-open) #mobileDesk,
body.desk-shell.desk-mobile.conv-view:not(.fb-desk-widget-open) #mobileTalkDock,
body.desk-shell.desk-mobile.conv-view:not(.fb-desk-widget-open) .mobile-desk-dock {
  display: none !important;
}
/* v366: logo stays capped. Do not restore an uncapped fieldbot-logo. */
body.desk-shell img[src*="fieldbot-logo"]:not(.owner-sticky-logo) {
  max-width: 56px !important;
  max-height: 56px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
body.desk-shell #fbDeskWidgetBtn img,
body.desk-shell .fb-desk-widget-btn img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain !important;
}


/* Heavy v381: mobile widget only. Desktop shop-chat unchanged. */
#fbDeskWidget .shop-chat-bubble { width: 100%; max-width: 100%; box-sizing: border-box; }
#fbDeskWidget .shop-chat-links { display: none; }
#fbDeskWidget .action-card { width: 100%; }
#fbDeskWidget .action-card .btn-row { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
#fbDeskWidget .action-card .btn { min-height: 44px; width: 100%; }


@media (max-width: 900px) {
  .fb-desk-widget-win {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    max-height: none !important;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 9999;
  }

  #mobileDeskThread,
  .mobile-desk-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  #mobileDeskDoc {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .fb-desk-widget-win.is-doc #mobileDeskThread { display: none; }
  .fb-desk-widget-win.is-doc #mobileDeskDoc { display: block; }

  .fb-desk-widget-win .shop-chat-form,
  .fb-desk-widget-win #shopChatForm,
  .fb-desk-widget-win .mobile-desk-composer {
    flex: 0 0 auto;
  }
}


@media (max-width: 900px) {
/* last ship’s body.conv-view rules stay here, unchanged */
body.conv-view {
  overflow: hidden;
}
body.conv-view .thread-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  overflow: hidden;
}
body.conv-view .thread-wrap .imsg-pane,
body.conv-view .thread-wrap .imsg-thread-only {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.conv-view .imsg-head {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 auto;
}
body.conv-view .imsg-close {
  position: sticky;
  top: 0;
  z-index: 21;
}
body.conv-view .imsg-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
body.conv-view .imsg-compose,
body.conv-view .imsg-composer,
body.conv-view .thread-compose {
  flex: 0 0 auto;
  padding-bottom: var(--conv-kb, 0px);
}
body.conv-view .app-tabs,
body.conv-view nav.tabs,
body.conv-view #tabBar,
body.conv-view .bottom-nav {
  flex: 0 0 auto;
  position: relative;
  z-index: 30;
  pointer-events: auto;
}
body.conv-view .mobile-bottom-nav,
body.conv-view #mobileBottomNav {
  z-index: 30;
  pointer-events: auto;
}
body.conv-view a.imsg-phone {
  color: inherit;
  text-decoration: underline;
  pointer-events: auto;
}
}

@media (min-width: 901px) {
  .imsg-list-col .imsg-row,
  #threads .imsg-row,
  .conv-wrap .imsg-row {
    position: relative;
    overflow: hidden;
    margin: 0;
    transform: none;
    pointer-events: none;
  }
  .imsg-row::before,
  .imsg-row::after {
    content: none !important;
    display: none !important;
  }
  .imsg-row .imsg-row-hit {
    pointer-events: auto;
    position: relative;
    inset: auto;
    display: block;
  }
  .imsg-row button,
  .imsg-row [data-row-act],
  .imsg-row a.imsg-phone,
  .imsg-row a.imsg-client-link {
    pointer-events: auto;
    position: relative;
    z-index: 2;
  }
  .imsg-row a[href^="/conversations/"] {
    position: static;
    inset: auto;
  }

  body.desk-shell.conv-view .thread-wrap.imsg-one {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: none;
    overflow: hidden;
  }

  body.desk-shell.conv-view .imsg-thread-col.imsg-thread-only {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: calc(100dvh - 168px);
    overflow: hidden;
  }

  body.desk-shell.conv-view .imsg-head {
    flex: 0 0 auto;
    position: relative;
  }

  body.desk-shell.conv-view .imsg-thread.imsg-thread-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.desk-shell.conv-view .imsg-compose {
    flex: 0 0 auto;
  }
}

.client-form-card .client-form-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 15px;
}
.client-form-card .client-form-row span { color: #64748B; }
.client-form-card .client-form-ask { margin: 10px 0 0; font-weight: 600; }

.crew-form-card .client-form-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 15px;
}
.crew-form-card .client-form-row span { color: #64748B; }
.crew-form-card .client-form-ask { margin: 10px 0 0; font-weight: 600; }

.sub-form-card .client-form-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 15px;
}
.sub-form-card .client-form-row span { color: #64748B; }
.sub-form-card .client-form-ask { margin: 10px 0 0; font-weight: 600; }

/* Document lives in the middle Live Desk. Chat stays visible. */
body.desk-doc-open #app.live-doc-host,
#app.live-doc-host {
  display: block;
  height: 100%;
  overflow: hidden;
}
body.desk-doc-open #docWorkspace,
#app > #docWorkspace {
  position: relative !important;
  inset: auto !important;
  z-index: 1 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  margin: 0 !important;
}
body.desk-doc-open #docWorkspace .doc-ws-main-card {
  height: 100%;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
}
body.desk-doc-center #docWorkspace {
  position: relative !important;
  inset: auto !important;
  z-index: 1 !important;
}

.imsg-row,
.conv-wrap .imsg-row,
.imsg-inbox .imsg-row {
  pointer-events: auto !important;
  cursor: pointer !important;
}
.imsg-row-hit { pointer-events: auto !important; }
body.desk-doc-open.conv-view #docWorkspace { display: none !important; }

#app > #docWorkspace {
  display: block !important;
  position: relative !important;
  inset: auto !important;
  width: 100%;
  min-height: 70vh;
}
body.desk-doc-center #docWorkspace {
  position: relative !important;
  inset: auto !important;
}

/* artifacts/GROKBOT_MOBILE_DOC_CHAT.css
   Phone Chat tab hides .mainpane. A doc lives there, so keep it visible
   when mobile-doc-mode is on. Top ~58% letterhead, thin FieldBot strip,
   keyboard via visualViewport (--vv-height). */
body.desk-shell.mobile-doc-mode {
  --mobile-nav-h: 0px;
}
body.desk-shell.mobile-doc-mode .mobile-bottom-nav,
body.desk-shell.mobile-doc-mode #mobileBottomNav,
body.desk-shell.mobile-doc-mode .chat-fab,
body.desk-shell.mobile-doc-mode #chatFab,
body.desk-shell.mobile-doc-mode .fb-desk-widget-btn,
body.desk-shell.mobile-doc-mode #fbDeskWidgetBtn,
body.desk-shell.mobile-doc-mode .owl-watermark,
body.desk-shell.mobile-doc-mode .shop-chat-watermark,
body.desk-shell.mobile-doc-mode .live-chat-rail {
  display: none !important;
}
@media (max-width: 800px) {
  html:has(body.mobile-doc-mode),
  body.desk-shell.mobile-doc-mode {
    height: var(--vv-height, var(--desk-vh, 100dvh));
    max-height: var(--vv-height, var(--desk-vh, 100dvh));
    overflow: hidden;
  }
  body.desk-shell.mobile-doc-mode .desk-col,
  body.desk-shell.mobile-doc-mode .desk {
    height: var(--vv-height, var(--desk-vh, 100dvh)) !important;
    max-height: var(--vv-height, var(--desk-vh, 100dvh)) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  body.desk-shell.mobile-doc-mode .desk,
  body.desk-shell.live-split.mobile-doc-mode .desk,
  body.desk-shell.mobile-tab-chat.mobile-doc-mode .desk,
  body.desk-shell.live-split.mobile-tab-chat.mobile-doc-mode .desk {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 58%) minmax(0, 42%) !important;
  }
  /* Do not hide Live Desk while a doc is open, even on Chat tab. */
  body.desk-shell.mobile-tab-chat.mobile-doc-mode .mainpane,
  body.desk-shell.mobile-doc-mode .mainpane {
    display: flex !important;
    flex-direction: column;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden;
  }
  body.desk-shell.mobile-doc-mode .owner-sticky,
  body.desk-shell.mobile-doc-mode .desk-topbar,
  body.desk-shell.mobile-doc-mode .preview-banner,
  body.desk-shell.mobile-doc-mode .trial-banner {
    display: none !important;
  }
  body.desk-shell.mobile-doc-mode .mainpane-body,
  body.desk-shell.mobile-doc-mode #app {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding-bottom: 0 !important;
  }
  body.desk-shell.mobile-doc-mode #app > #docWorkspace,
  body.desk-shell.mobile-doc-mode #docWorkspace {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    max-height: 100%;
    overflow: auto;
  }
  body.desk-shell.mobile-tab-chat.mobile-doc-mode .chatpane,
  body.desk-shell.live-split.mobile-tab-chat.mobile-doc-mode .chatpane,
  body.desk-shell.mobile-doc-mode .chatpane {
    display: flex !important;
    flex-direction: column;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    border-top: 1px solid var(--line, #e2e8f0);
  }
  body.desk-shell.mobile-doc-mode .chatpane .shop-chat {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }
  body.desk-shell.mobile-doc-mode .shop-chat-head,
  body.desk-shell.mobile-doc-mode .shop-chat-status,
  body.desk-shell.mobile-doc-mode .shop-chat-actions,
  body.desk-shell.mobile-doc-mode #shopChatHints,
  body.desk-shell.mobile-doc-mode .shop-chat-pending,
  body.desk-shell.mobile-doc-mode .shop-chat-file-err {
    display: none !important;
  }
  body.desk-shell.mobile-doc-mode .shop-chat-thread,
  body.desk-shell.mobile-doc-mode .shop-chat-log {
    flex: 0 0 auto;
    overflow: hidden;
    max-height: 3.4rem;
    min-height: 0;
    padding: 0.25rem 0.85rem;
    gap: 0;
  }
  body.desk-shell.mobile-doc-mode .shop-chat-log > *:not(:last-child) {
    display: none !important;
  }
  body.desk-shell.mobile-doc-mode .shop-chat-log > *:last-child {
    max-width: 100%;
    margin: 0;
    padding: 0.35rem 0;
    font-size: 0.92rem;
  }
  body.desk-shell.mobile-doc-mode .shop-chat-dock {
    flex: 0 0 auto;
    margin-top: auto;
  }
  body.desk-shell.mobile-doc-mode .shop-chat-form {
    padding: 0.4rem 0.7rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  }
}

/* GROKBOT_MOBILE_WIDGET_COMPOSER.css
   Letterhead stays in #app. Owl window is a 108px bar at the bottom of
   visualViewport (--desk-vh), sitting on the keys. Bar = last FieldBot
   line + #fbDeskWidgetInput. Actions / mobile chips / header / nav hide
   until cancel. */
@media (max-width: 900px) {
  body.desk-shell.mobile-doc-mode {
    --chat-sliver: 108px;
    height: var(--desk-vh, 100dvh);
    max-height: var(--desk-vh, 100dvh);
    overflow: hidden;
  }
  body.desk-shell.mobile-doc-mode .desk,
  body.desk-shell.live-split.mobile-doc-mode .desk,
  body.desk-shell.mobile-tab-chat.mobile-doc-mode .desk,
  body.desk-shell.live-split.mobile-tab-chat.mobile-doc-mode .desk {
    display: block !important;
    height: var(--desk-vh, 100dvh) !important;
    max-height: var(--desk-vh, 100dvh) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    grid-template-rows: none !important;
  }
  body.desk-shell.mobile-doc-mode .mainpane,
  body.desk-shell.mobile-tab-chat.mobile-doc-mode .mainpane,
  body.desk-shell.conv-view.mobile-doc-mode .mainpane {
    display: flex !important;
    visibility: visible !important;
    flex-direction: column;
    min-height: 0 !important;
  }
  body.desk-shell.mobile-doc-mode #app {
    display: flex !important;
    visibility: visible !important;
    flex-direction: column;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: calc(var(--desk-vh, 100dvh) - var(--chat-sliver, 108px)) !important;
    max-height: calc(var(--desk-vh, 100dvh) - var(--chat-sliver, 108px)) !important;
    min-height: 0 !important;
    z-index: 62 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--bg);
  }
  body.desk-shell.mobile-doc-mode #docWorkspace,
  body.desk-shell.mobile-doc-mode #app > #docWorkspace,
  body.desk-shell.desk-doc-open.conv-view.mobile-doc-mode #docWorkspace,
  body.desk-shell.conv-view.mobile-doc-mode #app > #docWorkspace {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto !important;
    z-index: 1 !important;
  }
  body.desk-shell.mobile-doc-mode #docWorkspace .doc-ws-main,
  body.desk-shell.mobile-doc-mode #docWorkspace .doc-ws-main-card,
  body.desk-shell.mobile-doc-mode #docWsFrame,
  body.desk-shell.mobile-doc-mode .doc-ws-preview,
  body.desk-shell.mobile-doc-mode .doc-ws-preview iframe {
    height: 100%;
    min-height: 0;
  }
  body.desk-shell.mobile-doc-mode .chatpane,
  body.desk-shell.mobile-tab-chat.mobile-doc-mode .chatpane,
  body.desk-shell.live-split.mobile-tab-chat.mobile-doc-mode .chatpane {
    display: none !important;
  }
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win.open,
  body.desk-shell.fb-desk-widget-open.mobile-doc-mode .fb-desk-widget-win {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(var(--desk-vh, 100dvh) - var(--chat-sliver, 108px)) !important;
    bottom: auto !important;
    width: 100% !important;
    height: var(--chat-sliver, 108px) !important;
    max-height: var(--chat-sliver, 108px) !important;
    z-index: 70 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    box-shadow: none;
  }
  body.desk-shell.mobile-doc-mode #shopChatActions,
  body.desk-shell.mobile-doc-mode #shopChatHints,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-head,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win .fb-desk-widget-head,
  body.desk-shell.mobile-doc-mode #mobileBottomNav,
  body.desk-shell.mobile-doc-mode .mobile-bottom-nav,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-btn,
  body.desk-shell.mobile-doc-mode #fbDeskWidgetBtn,
  body.desk-shell.mobile-doc-mode #mobileDeskDoc,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win #mobileDeskDoc,
  body.desk-shell.mobile-doc-mode #mobileTalkDock,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win #mobileTalkDock,
  body.desk-shell.mobile-doc-mode #mobileDeskForm,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win #mobileDeskForm,
  body.desk-shell.mobile-doc-mode #mobileDeskChips,
  body.desk-shell.mobile-doc-mode .mobile-desk-chips,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win #mobileDeskChips,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win .mobile-desk-chips,
  body.desk-shell.fb-desk-widget-open.mobile-doc-mode .fb-desk-widget-win #mobileDeskChips,
  body.desk-shell.mobile-page-open.fb-desk-widget-open.mobile-doc-mode .fb-desk-widget-win #mobileDeskChips,
  body.desk-shell.mobile-page-open.fb-desk-widget-open.mobile-doc-mode .fb-desk-widget-win .mobile-desk-chips,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win.open #mobileDeskChips,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win.open .mobile-desk-chips {
    display: none !important;
  }
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win #mobileDeskThread,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win .mobile-desk-thread {
    display: block !important;
    order: 1;
    flex: 0 0 auto !important;
    max-height: 28px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 0.75rem;
  }
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win #mobileDeskThread > *:not(:last-child),
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win .mobile-desk-thread > *:not(:last-child) {
    display: none !important;
  }
  body.desk-shell.mobile-doc-mode #fbDeskWidgetForm,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win #fbDeskWidgetForm,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win:has(#mobileTalkDock) #fbDeskWidgetForm {
    display: flex !important;
    visibility: visible !important;
    order: 2;
    flex: 1 1 auto !important;
    height: auto;
    min-height: 40px;
    margin: 0;
    padding: 8px;
    align-items: center;
  }
  body.desk-shell.mobile-doc-mode #fbDeskWidgetInput {
    display: block !important;
    min-height: 40px !important;
    max-height: 40px !important;
    flex: 1;
  }
}


@media (max-width: 860px) {
  html.mobile-doc-mode,
  body.mobile-doc-mode {
    position: fixed !important;
    overflow: hidden !important;
    width: 100% !important;
    height: var(--vv-h, 100dvh) !important;
    top: var(--vv-top, 0px) !important;
    left: 0 !important;
    background: #fff !important;
  }
  body.mobile-doc-mode #app {
    position: fixed !important;
    top: var(--vv-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(var(--vv-h, 100dvh) - 108px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  body.mobile-doc-mode .fb-desk-widget-win {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(var(--vv-top, 0px) + var(--vv-h, 100dvh) - 108px) !important;
    bottom: auto !important;
    height: 108px !important;
    max-height: 108px !important;
  }
  body.mobile-doc-mode .shop-chat-hints,
  body.mobile-doc-mode .fb-desk-widget-actions,
  body.mobile-doc-mode .fb-desk-widget-head,
  body.mobile-doc-mode .fb-desk-widget-nav,
  body.mobile-doc-mode .fb-desk-owl-btn {
    display: none !important;
  }
  body.mobile-doc-mode #fbDeskWidgetForm,
  body.mobile-doc-mode #fbDeskWidgetInput {
    display: block !important;
    visibility: visible !important;
  }
}

/* v464: James visualViewport pin must beat GROKBOT 900px --desk-vh / 100dvh / bottom:0 */
@media (max-width: 860px) {
  html.mobile-doc-mode,
  html.mobile-doc-mode body.desk-shell.mobile-doc-mode,
  body.desk-shell.mobile-doc-mode {
    position: fixed !important;
    overflow: hidden !important;
    width: 100% !important;
    height: var(--vv-h, 100dvh) !important;
    max-height: var(--vv-h, 100dvh) !important;
    top: var(--vv-top, 0px) !important;
    left: 0 !important;
    background: #fff !important;
  }
  html.mobile-doc-mode body.desk-shell.mobile-doc-mode #app,
  body.desk-shell.mobile-doc-mode #app {
    position: fixed !important;
    top: var(--vv-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(var(--vv-h, 100dvh) - 108px) !important;
    max-height: calc(var(--vv-h, 100dvh) - 108px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  html.mobile-doc-mode body.desk-shell.mobile-doc-mode .fb-desk-widget-win,
  html.mobile-doc-mode body.desk-shell.mobile-doc-mode .fb-desk-widget-win.open,
  html.mobile-doc-mode body.desk-shell.fb-desk-widget-open.mobile-doc-mode .fb-desk-widget-win,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win,
  body.desk-shell.mobile-doc-mode .fb-desk-widget-win.open,
  body.desk-shell.fb-desk-widget-open.mobile-doc-mode .fb-desk-widget-win {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(var(--vv-top, 0px) + var(--vv-h, 100dvh) - 108px) !important;
    bottom: auto !important;
    height: 108px !important;
    max-height: 108px !important;
  }
}

.sched-month { padding: 8px 4px 16px; }
.sched-month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sched-month .month-cell { cursor: pointer; text-align: left; border: 1px solid var(--line, #e5e7eb); background: #fff; min-height: 64px; }
.sched-month .month-cell.is-pick { outline: 2px solid var(--accent, #0b84ff); }
.sched-month .month-cell.has-job { font-weight: 600; }
.sched-month .sched-mark { font-size: 11px; line-height: 1.2; color: var(--ink, #123); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-facts { margin-top: 10px; font-size: 13px; }
.sched-facts .ln { display: flex; gap: 8px; }
.sched-facts .ln span { color: var(--muted, #667); min-width: 64px; }


/* v470: Conversations All · Email · Text · Calls */
.convo-tabs { margin: 8px 0 12px; gap: .4rem; align-items: center; }
.convo-tabs .imsg-chan {
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: .78rem;
  padding: .28rem .78rem;
  min-height: 32px;
  letter-spacing: .02em;
}
.convo-tabs .imsg-chan.on {
  background: #0B1F3A;
  color: #fff;
  border-color: #0B1F3A;
}

/* ==========================================================================
   JOB GROK BLACK — internal desk skin (last-wins)
   Logged-in shop is ground #000, cards #0A0A0A, type #E8E8E8, mute #8A8A8A.
   Electric #2B7FFF only on Send / primary / active chip / selected tab /
   unread badge / working links. Letterhead / print stay white paper.
   No grain. No navy fill. No beige. No electric page wash.
   Do not restyle HQ login or public.css.
   ========================================================================== */

:root {
  --bg: #000000;
  --bg-2: #0A0A0A;
  --panel: #0A0A0A;
  --panel-2: #0A0A0A;
  --ink: #E8E8E8;
  --muted: #8A8A8A;
  --faint: #8A8A8A;
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.20);
  --accent: #2B7FFF;
  --electric: #2B7FFF;
  --accent-2: #2B7FFF;
  --glow: transparent;
  --navy: #000000;
  --steel: #8A8A8A;
  --fb-bg: #000000;
  --fb-bg-2: #0A0A0A;
  --fb-ink: #E8E8E8;
  --fb-ink-2: #FFFFFF;
  --fb-muted: #8A8A8A;
  --fb-faint: #8A8A8A;
  --fb-line: #2A2A2A;
  --fb-line-2: rgba(255, 255, 255, 0.20);
  --fb-primary: #2B7FFF;
  --fb-navy: #000000;
  --fb-chrome-ink: #E8E8E8;
  --sidebar-bg: #000000;
  --sidebar-text: #E8E8E8;
  --sidebar-muted: #8A8A8A;
  --sidebar-border: rgba(255, 255, 255, 0.12);
  --sidebar-accent: #2B7FFF;
  --sidebar-active-bg: transparent;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
}

body.desk-shell {
  --bg: #000000;
  --bg-2: #0A0A0A;
  --panel: #0A0A0A;
  --panel-2: #0A0A0A;
  --ink: #E8E8E8;
  --muted: #8A8A8A;
  --faint: #8A8A8A;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #2B7FFF;
  --electric: #2B7FFF;
  --glow: transparent;
  --navy: #000000;
  --fb-bg: #000000;
  --fb-bg-2: #0A0A0A;
  --fb-ink: #E8E8E8;
  --fb-muted: #8A8A8A;
  --fb-primary: #2B7FFF;
  --fb-navy: #000000;
  --fb-line: #2A2A2A;
  --sidebar-bg: #000000;
  --sidebar-text: #E8E8E8;
  --sidebar-muted: #8A8A8A;
  --sidebar-border: rgba(255, 255, 255, 0.12);
  --sidebar-accent: #2B7FFF;
  --sidebar-active-bg: transparent;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  background: #000 !important;
  color: #E8E8E8 !important;
}

/* No grain — true black */
body.desk-shell::before {
  display: none !important;
  content: none !important;
  background: none !important;
  opacity: 0 !important;
}

html,
body,
.shell,
.mainpane,
.workspace,
html.desk-ready,
body.desk-shell,
body.desk-shell .shell,
body.desk-shell .mainpane,
body.desk-shell .main-stage,
body.desk-shell .mainpane-body,
body.desk-shell .desk,
body.desk-shell .desk-col,
body.desk-shell .chatpane,
body.desk-shell .live-chat-rail,
body.login-body:not(.hq-login-body),
body.crew-portal,
body.crew-portal .crew-app {
  background: #000;
  color: #E8E8E8;
}

a:hover { color: var(--accent); }

/* Beat leftover navy panels + pkt-view white chrome (not letterhead) */
body.desk-shell .chatpane,
body.desk-shell .chatpane .shop-chat,
body.desk-shell .shop-chat-log,
body.desk-shell .shop-chat-thread,
body.desk-shell .live-chat-rail,
body.desk-shell .fb-desk-widget-btn,
body.desk-shell #fbDeskWidgetBtn,
body.desk-shell.pkt-view #app,
body.desk-shell.pkt-view #app.main-stage,
body.desk-shell.pkt-view .mainpane-body,
body.desk-shell.pkt-view .jobfile,
body.desk-shell.pkt-view .jobfile-head,
body.desk-shell.pkt-view .pkt-header,
body.desk-shell.pkt-view .jobfile > .jobfile-head {
  background: #000 !important;
  background-color: #000 !important;
  color: #E8E8E8 !important;
  box-shadow: none;
}
body.desk-shell.pkt-view .jobfile,
body.desk-shell.pkt-view .pkt {
  background: #0A0A0A !important;
  background-color: #0A0A0A !important;
}

body.desk-shell .shop-chat-form,
body.desk-shell .shop-chat-head,
body.desk-shell .shop-chat,
body.desk-shell .imsg-pane,
body.desk-shell .imsg-compose,
body.desk-shell .imsg-thread,
body.desk-shell .money-block,
body.desk-shell .board-stage,
body.desk-shell .pkt-tab,
body.desk-shell .rs0-card,
body.desk-shell .pkt-next-owner > div,
body.desk-shell .pkt-site-progress > div {
  background: #0A0A0A !important;
  color: #E8E8E8 !important;
  border-color: var(--line, rgba(255,255,255,.12));
}

/* Header / nav: black, white labels, electric only on active + Start/Send */
body.desk-shell .topbar,
body.desk-shell .owner-sticky,
body.desk-shell .owner-sticky.top-chrome,
body.desk-shell .desk-topbar,
body.desk-shell .mobile-desk-head,
.topbar,
.owner-sticky,
.desk-topbar {
  background: #000 !important;
  color: #fff !important;
  border-bottom-color: var(--line) !important;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.12));
}

body.desk-shell .sidebar {
  background: #000 !important;
  color: #E8E8E8 !important;
  border-right-color: var(--sidebar-border) !important;
}
body.desk-shell .sidebar-nav a {
  color: #E8E8E8;
  background: transparent;
}
body.desk-shell .sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
body.desk-shell .sidebar-nav a.on,
body.desk-shell .topnav a.on,
body.desk-shell .tab.on {
  background: transparent !important;
  color: #2B7FFF !important;
  box-shadow: none;
  border-color: #2B7FFF;
}

body.desk-shell .topbar-shop,
body.desk-shell .top-chrome-shop,
body.desk-shell .top-chrome-cluster,
body.desk-shell .owner-sticky-brand,
body.desk-shell .owner-sticky-brand:hover,
body.desk-shell .mobile-desk-shop {
  color: #fff !important;
}
body.desk-shell .live-doc-type { color: #E8E8E8 !important; }

.login-body:not(.hq-login-body) .login-card {
  background: #0A0A0A;
  border-color: var(--line);
  color: #E8E8E8;
}
.login-body:not(.hq-login-body) .brand,
.login-body:not(.hq-login-body) .brand-lg,
.login-body:not(.hq-login-body) .crew-login-title {
  color: #E8E8E8;
}

/* Cards / bubbles — #0A0A0A, not leftover white */
body.desk-shell .live-section,
body.desk-shell .live-quick,
body.desk-shell .live-row,
body.desk-shell .live-row-empty,
body.desk-shell .imsg-row,
body.desk-shell .imsg-row-box,
body.desk-shell .list-row,
body.desk-shell .pkt,
body.desk-shell .job-card,
body.desk-shell .job-snap,
body.desk-shell .job-snap div,
body.desk-shell .desk-table,
body.desk-shell .desk-table th,
body.desk-shell .composer,
body.desk-shell .sched-month .month-cell,
body.desk-shell .mobile-more-nav a,
body.desk-shell .mobile-more-card,
body.desk-shell .crew-job,
body.desk-shell .fb-desk-widget-win,
body.desk-shell .fb-desk-widget-win .mobile-desk-thread,
body.desk-shell .jobfile-head,
body.desk-shell .existing-carrier,
body.desk-shell .receipt-card:not(.letterhead):not(.doc-paper) {
  background: #0A0A0A !important;
  color: #E8E8E8 !important;
  border-color: var(--line, rgba(255,255,255,.12));
}

body.desk-shell .live-quick-lead,
body.desk-shell .live-section-title,
body.desk-shell .live-section-sub,
body.desk-shell .live-row,
body.desk-shell .imsg-row:hover .name,
body.desk-shell .desk-table .name,
body.desk-shell .crew-job p,
body.desk-shell .mobile-more-head h2 {
  color: #E8E8E8 !important;
}
body.desk-shell .live-section-title,
body.desk-shell .live-section-sub,
body.desk-shell .crew-job p {
  color: #8A8A8A !important;
}

body.desk-shell .live-quick,
body.desk-shell .live-section,
body.desk-shell .live-row,
body.desk-shell .job-card,
body.desk-shell .job-snap div,
body.desk-shell .desk-table,
body.desk-shell .pkt,
body.desk-shell .list-row,
body.desk-shell .crew-job,
body.desk-shell .mobile-more-nav a {
  border: 1px solid var(--line, rgba(255,255,255,.12));
  box-shadow: none;
}

/* Composer chrome + inputs (not letterhead) */
body.desk-shell .composer {
  background: #0A0A0A !important;
  border: 1px solid var(--line, rgba(255,255,255,.12)) !important;
  box-shadow: none;
}
body.desk-shell .composer input,
body.desk-shell .composer input:focus {
  background: #000 !important;
  color: #E8E8E8 !important;
}

body.desk-shell input,
body.desk-shell select,
body.desk-shell textarea,
body.login-body:not(.hq-login-body) input,
body.login-body:not(.hq-login-body) select,
body.login-body:not(.hq-login-body) textarea,
body.desk-shell #deskSearchInput,
body.desk-shell #mobileDeskInput,
body.desk-shell #fbDeskWidgetInput,
body.desk-shell #fbDeskWidgetForm {
  background: #000 !important;
  color: #fff !important;
  border-color: var(--line, #2A2A2A) !important;
}
body.desk-shell input::placeholder,
body.desk-shell textarea::placeholder {
  color: #8A8A8A;
}

/* Primary / Send — electric */
.btn-primary,
.composer-go,
.shop-chat-send,
#shopChatSend,
.mobile-desk-form .btn-primary,
body.desk-shell .mobile-command button[type="submit"],
body.desk-shell .mobile-send-plane,
#fbDeskWidgetForm button[type="submit"],
body.desk-shell .btn-primary {
  background: #2B7FFF !important;
  border-color: #2B7FFF !important;
  color: #fff !important;
}
.btn-primary:hover,
.composer-go:hover,
body.desk-shell .btn-primary:hover {
  background: #2B7FFF !important;
  border-color: #2B7FFF !important;
  color: #fff !important;
  filter: brightness(1.08);
}

body.desk-shell .btn:not(.btn-primary):not(.btn-danger):not(.btn-done) {
  border-color: var(--line, #2A2A2A);
  color: #E8E8E8;
  background: transparent;
}

/* Chips — black fill, electric-40 outline; .on = solid electric */
body.desk-shell .chip,
body.desk-shell .live-quick-chip,
body.desk-shell .convo-tabs .imsg-chan {
  background: #000 !important;
  color: #E8E8E8 !important;
  border: 1px solid rgba(43, 127, 255, 0.4) !important;
}
body.desk-shell .chip.on,
body.desk-shell .chip[aria-pressed="true"],
body.desk-shell .live-quick-chip.on,
body.desk-shell .convo-tabs .imsg-chan.on,
.chip.on,
.chip[aria-pressed="true"] {
  background: #000 !important;
  color: #2B7FFF !important;
  border: 1px solid #2B7FFF !important;
}

/* Talk bubbles — no iMessage gray */
body.desk-shell .bubble-row.in .bubble,
body.desk-shell .shop-chat-bubble.assistant,
body.desk-shell .chatpane .shop-chat-bubble.assistant,
body.desk-shell .doc-ws-chat-card {
  background: #0A0A0A !important;
  color: #E8E8E8 !important;
  border: 1px solid rgba(43, 127, 255, 0.4) !important;
  box-shadow: none;
}
body.desk-shell .bubble-row.out .bubble,
body.desk-shell .shop-chat-bubble.user,
body.desk-shell .chatpane .shop-chat-bubble.user {
  background: #2B7FFF !important;
  color: #fff !important;
  border: 1px solid #2B7FFF !important;
}

/* Unread badge — electric */
body.desk-shell .imsg-unread,
body.desk-shell .mobile-talk-unread,
body.desk-shell #urgentCount,
body.desk-shell #convoCount,
body.desk-shell .nav-count,
body.desk-shell .mobile-bottom-nav .nav-count {
  background: #2B7FFF;
  color: #fff;
}

body.desk-shell a.doc-link,
body.desk-shell .file-onfile a,
body.desk-shell .shop-chat-bubble.assistant a.doc-link {
  color: #2B7FFF;
}

/* Header owl — 40px desktop / 32px mobile. Not a billboard. */
.topbar .fieldbot-mark-sm,
.sidebar .fieldbot-mark-sm,
.sidebar .brand .fieldbot-mark,
body.desk-shell .topbar .fieldbot-mark-sm,
body.desk-shell .sidebar .fieldbot-mark-sm,
body.desk-shell .sidebar .brand .fieldbot-mark,
body.desk-shell .sidebar .fieldbot-mark.fieldbot-mark-sm,
body.desk-shell .owner-sticky-logo {
  height: 40px !important;
  width: auto !important;
  max-width: 140px !important;
  max-height: 40px !important;
  object-fit: contain !important;
}

/* KEEP WHITE — estimate / invoice / receipt letterhead + print paper */
.doc-ws-main-card,
.doc-ws-main .doc-ws-preview,
.doc-ws-main .doc-ws-preview iframe,
.doc-ws-preview,
.doc-ws-preview iframe,
.doc-line,
.doc-line input,
.doc-line textarea,
.doc-line select,
body.desk-shell .doc-ws-main-card,
body.desk-shell .doc-ws-main-card input,
body.desk-shell .doc-ws-main-card textarea,
body.desk-shell .doc-ws-main-card select,
body.desk-shell.mobile-doc-mode .doc-ws-main-card,
body.desk-shell.mobile-doc-mode .doc-ws-preview,
body.desk-shell.mobile-doc-mode .doc-ws-preview iframe,
html.mobile-doc-mode .doc-ws-main-card,
html.mobile-doc-mode .doc-ws-preview,
html.mobile-doc-mode .doc-line {
  background: #fff !important;
  color: #0F172A !important;
  border-color: #E2E8F0;
}

@media print {
  .doc-ws-main-card,
  .doc-ws-preview,
  .doc-ws-preview iframe,
  .doc-line,
  html, body {
    background: #fff !important;
    color: #0F172A;
  }
}

/* HQ login — leave as-is (already near-black) */
.hq-login-body { background: #050608; }

@media (max-width: 860px) {
  body.desk-shell .mainpane,
  body.desk-shell .main-stage,
  body.desk-shell .mainpane-body {
    background: #000 !important;
    color: #E8E8E8 !important;
  }
  body.desk-shell .mobile-bottom-nav {
    z-index: 200;
    pointer-events: auto;
    background: #000 !important;
    color: #E8E8E8 !important;
    border-top: 1px solid var(--line, #2A2A2A) !important;
    box-shadow: none;
  }
  body.desk-shell .mobile-bottom-nav a,
  body.desk-shell .mobile-bottom-nav button {
    color: #8A8A8A !important;
    background: transparent !important;
  }
  body.desk-shell .mobile-bottom-nav .on,
  body.desk-shell .mobile-bottom-nav .on .nav-ico { color: #2B7FFF !important; }
  body.desk-shell .mobile-desk-head {
    background: #000 !important;
    color: #fff !important;
  }
  body.desk-shell .owner-sticky,
  body.desk-shell .owner-sticky.top-chrome {
    background: #000 !important;
    color: #fff !important;
    border-bottom: 1px solid var(--line, #2A2A2A) !important;
  }
  body.desk-shell .top-chrome-shop,
  body.desk-shell .owner-sticky .mobile-menu,
  body.desk-shell.live-split .owner-sticky .mobile-menu {
    color: #fff !important;
    border-color: var(--line, #2A2A2A) !important;
    background: #000 !important;
  }
  body.desk-shell .mobile-command {
    background: #0A0A0A !important;
    border: 1px solid var(--line, #2A2A2A) !important;
    box-shadow: none;
  }
  .topbar .fieldbot-mark-sm,
  .sidebar .fieldbot-mark-sm,
  .sidebar .brand .fieldbot-mark,
  body.desk-shell .topbar .fieldbot-mark-sm,
  body.desk-shell .sidebar .fieldbot-mark-sm,
  body.desk-shell .sidebar .brand .fieldbot-mark,
  body.desk-shell .sidebar .fieldbot-mark.fieldbot-mark-sm,
  body.desk-shell .owner-sticky-logo,
  body.desk-shell .mobile-desk-logo {
    height: 32px !important;
    max-height: 32px !important;
    max-width: 140px !important;
    width: auto !important;
    object-fit: contain !important;
  }
  html[data-hc="1"] body.desk-shell .live-main .meta,
  html[data-hc="1"] body.desk-shell .imsg-preview {
    color: var(--muted);
  }
}

/* v502: Desktop Live leads — 560px max, centered in the middle pane.
   Replaces v500 full-bleed 4-col (72px / 88px action). Live home only.
   Jobs/leads .pkt-list is a different main-stage board — do not smash it.
   Does not restyle mobile (max-width: 860px). */
@media (min-width: 861px) {
  body.desk-shell .live-desk .live-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
  }
  body.desk-shell .live-desk .live-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.desk-shell .live-desk .live-section-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(100%, 520px);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  body.desk-shell .live-desk .live-section-list > .live-row,
  body.desk-shell .live-desk .live-section-list > .live-job-card,
  body.desk-shell .live-desk .live-section-list > .list-row {
    /* v506: GRID killed. Vertical stack. James last-wins below. */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 4px;
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    min-height: 96px;
    height: auto;
    padding: 14px 16px;
    margin: 0;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    background: #0A0A0A;
    overflow: hidden !important;
    position: relative;
    inset: auto;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    float: none;
    grid-template-columns: none;
  }

  /* v505: neutralized v502 nested-grid / display:contents overlay.
     Rows are 3 direct children (name | note | when). Do not restore
     grid-column on .name/.meta/.live-when/.live-main or display:contents. */

  body.desk-shell .live-desk .live-section-list > .live-row-empty {
    grid-template-columns: none;
    min-height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  body.desk-shell .live-desk .live-section-list > .live-row-empty > .live-main {
    display: block;
    grid-column: auto;
  }
}

/* ==========================================================================
   v501 COHESION — kill leftover white/beige plates on the black desk.
   Thread heads, empty states, section titles, Talk/Live/Notes/Job chrome.
   Letterhead / print / Leaflet map stay white paper. No JS. Last-wins.
   ========================================================================== */

/* Sticky thread + packet heads: no frosted rgba(252,252,252) sticker */
body.desk-shell .imsg-head,
body.desk-shell.conv-view .imsg-head,
body.desk-shell.conv-view .thread-wrap .imsg-head,
body.desk-shell.conv-view .thread-wrap .imsg-head.imsg-head,
body.desk-shell .pkt-live-head,
body.desk-shell.pkt-view .pkt-live-head,
body.desk-shell .jobfile-head,
body.desk-shell.pkt-view .jobfile-head,
body.desk-shell.pkt-view .pkt-header,
body.desk-shell.pkt-view .jobfile > .jobfile-head,
body.desk-shell .shop-chat-head,
body.desk-shell .chatpane .shop-chat-head,
body.desk-shell .fb-desk-widget-head,
body.desk-shell .mobile-desk-head,
body.desk-shell .mobile-desk-head.mobile-talk-head,
body.desk-shell .mobile-more-head {
  background: #000 !important;
  background-color: #000 !important;
  color: #E8E8E8 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border-bottom-color: rgba(255,255,255,.12);
}

/* No white square around Conversation / name / Talk / Live / Notes / Job labels */
body.desk-shell h1,
body.desk-shell h2,
body.desk-shell h3,
body.desk-shell .imsg-head h1,
body.desk-shell .imsg-head-name,
body.desk-shell .imsg-head-name-plain,
body.desk-shell .imsg-head-name a,
body.desk-shell .imsg-client-link,
body.desk-shell .thread-title,
body.desk-shell .pane-title,
body.desk-shell .section-h,
body.desk-shell .talk-head,
body.desk-shell .convo-head,
body.desk-shell .live-section-title,
body.desk-shell .live-section-head,
body.desk-shell .live-quick-lead,
body.desk-shell .board-lead,
body.desk-shell .board-lead h1,
body.desk-shell .subhead,
body.desk-shell .empty-state-title,
body.desk-shell .empty,
body.desk-shell .title,
body.desk-shell .pkt-live-head h1,
body.desk-shell .jobfile-head h1,
body.desk-shell .shop-chat-head h1,
body.desk-shell .mobile-more-head h2,
body.desk-shell .mobile-more-head h2,
body.desk-shell label,
body.desk-shell .field label {
  background: transparent !important;
  background-color: transparent !important;
}

body.desk-shell h1,
body.desk-shell h2,
body.desk-shell h3,
body.desk-shell .imsg-head,
body.desk-shell .imsg-head h1,
body.desk-shell .imsg-head-name,
body.desk-shell .imsg-head-name-plain,
body.desk-shell .imsg-head-name a,
body.desk-shell .imsg-client-link,
body.desk-shell .thread-title,
body.desk-shell .pane-title,
body.desk-shell .section-h,
body.desk-shell .talk-head,
body.desk-shell .convo-head,
body.desk-shell .live-quick-lead,
body.desk-shell .board-lead,
body.desk-shell .board-lead h1,
body.desk-shell .title,
body.desk-shell .pkt-live-head h1,
body.desk-shell .jobfile-head h1,
body.desk-shell .shop-chat-head h1,
body.desk-shell .mobile-more-head h2,
body.desk-shell .imsg-row .name,
body.desk-shell .imsg-row:hover .name,
body.desk-shell .live-main .name,
body.desk-shell .live-row .name {
  color: #E8E8E8 !important;
}

body.desk-shell .imsg-head .sub,
body.desk-shell .imsg-head .back,
body.desk-shell .imsg-phone,
body.desk-shell a.imsg-phone,
body.desk-shell .imsg-time,
body.desk-shell .imsg-preview,
body.desk-shell .imsg-job,
body.desk-shell .live-section-title,
body.desk-shell .live-section-sub,
body.desk-shell .subhead,
body.desk-shell .empty,
body.desk-shell .empty-state-body,
body.desk-shell .field label,
body.desk-shell .meta,
body.desk-shell .jobfile-phone,
body.desk-shell .shop-chat-head .sub {
  color: #8A8A8A !important;
  background: transparent !important;
}

body.desk-shell .imsg-close,
body.desk-shell.conv-view .imsg-close {
  color: #E8E8E8 !important;
  background: transparent !important;
}

/* Thread pane #000 — not a white/card plate. Bubbles stay #0A0A0A. */
body.desk-shell .imsg-pane,
body.desk-shell .imsg-thread,
body.desk-shell .imsg-thread-only,
body.desk-shell .imsg-thread-col,
body.desk-shell .imsg-thread-scroll,
body.desk-shell .thread-wrap,
body.desk-shell .home-wrap.conv-wrap,
body.desk-shell.conv-view .imsg-pane,
body.desk-shell.conv-view .imsg-thread,
body.desk-shell.conv-view .imsg-thread-only,
body.desk-shell.conv-view .thread-wrap,
body.desk-shell .shop-chat {
  background: #000 !important;
  background-color: #000 !important;
  color: #E8E8E8 !important;
}

/* Composer black, white type, electric Send */
body.desk-shell .imsg-compose,
body.desk-shell .imsg-composer,
body.desk-shell .thread-compose,
body.desk-shell.conv-view .imsg-compose,
body.desk-shell.conv-view .imsg-composer,
body.desk-shell.conv-view .thread-compose {
  background: #000 !important;
  background-color: #000 !important;
  color: #E8E8E8 !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: none !important;
}
body.desk-shell .imsg-compose textarea,
body.desk-shell .imsg-compose input,
body.desk-shell .imsg-compose textarea:focus,
body.desk-shell .imsg-compose input:focus {
  background: #000 !important;
  color: #fff !important;
  border-color: transparent !important;
}
body.desk-shell .imsg-compose .btn,
body.desk-shell .imsg-compose button[type="submit"],
body.desk-shell .imsg-compose .btn-primary {
  background: #2B7FFF !important;
  border-color: #2B7FFF !important;
  color: #fff !important;
}

/* Bubbles #0A0A0A + electric-40 / hairline — never iMessage gray / white */
body.desk-shell .bubble,
body.desk-shell .bubble-row.in .bubble,
body.desk-shell .bubble-row.out .bubble {
  background: #0A0A0A !important;
  color: #E8E8E8 !important;
  border: 1px solid rgba(43,127,255,.4) !important;
  box-shadow: none !important;
}
body.desk-shell .bubble-row.out .bubble {
  border-color: rgba(255,255,255,.12) !important;
}

/* Unread / active: electric only */
body.desk-shell .imsg-row.unread .name,
body.desk-shell .imsg-row.on .name {
  color: #2B7FFF !important;
}

/* Channel chips in thread head — not beige/navy stickers */
body.desk-shell .imsg-chan,
body.desk-shell .imsg-chan-call,
body.desk-shell .imsg-chan-email,
body.desk-shell .imsg-chan-web,
body.desk-shell .convo-tabs .imsg-chan {
  background: #000 !important;
  color: #8A8A8A !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}
body.desk-shell .imsg-chan.on,
body.desk-shell .convo-tabs .imsg-chan.on {
  background: #000 !important;
  color: #2B7FFF !important;
  border-color: #2B7FFF !important;
}

/* Empty states — no white card on black ground */
body.desk-shell .empty-state,
body.desk-shell .live-row-empty,
body.desk-shell .imsg-thread-empty,
html[data-theme="dark"] body.desk-shell .empty-state,
html[data-theme="light"] body.desk-shell .empty-state,
html[data-hc="1"] body.desk-shell .empty-state {
  background: #000 !important;
  background-color: #000 !important;
  color: #8A8A8A !important;
  border-color: rgba(255,255,255,.12) !important;
}
body.desk-shell .empty-state-title { color: #E8E8E8 !important; }

/* Inside-page leftover white plates (Live, Talk, board, jobs, schedule, More, settings, owl) */
body.desk-shell .action-card,
body.desk-shell .list-filter,
body.desk-shell .theme-toggle,
body.desk-shell .mobile-menu,
body.desk-shell .mobile-desk-chips,
body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-chips,
body.desk-shell .fb-desk-widget-win.open .mobile-desk-chips,
body.desk-shell .dispatch-contacts,
body.desk-shell .addr-ac-list,
body.desk-shell .home-seat,
body.desk-shell .home-money-chart,
body.desk-shell .info-block,
body.desk-shell .pill-status,
body.desk-shell .jobfile-status,
body.desk-shell .pkt-tab,
body.desk-shell .pkt-tab.is-on,
body.desk-shell .rs0-card,
body.desk-shell .rs0-invite-card,
body.desk-shell .rs0-today-job,
body.desk-shell .rd-face,
body.desk-shell .rd-today-by,
body.desk-shell .rd-handoff-card,
body.desk-shell .rd-coi-card,
body.desk-shell .board-urgent,
body.desk-shell .more-theme-row button,
body.desk-shell .shop-chat-head .ai-flag,
body.desk-shell .shop-chat-head .ai-flag.on,
body.desk-shell .webchat-snippet {
  background: #0A0A0A !important;
  color: #E8E8E8 !important;
  border-color: rgba(255,255,255,.12) !important;
  box-shadow: none !important;
}
body.desk-shell .pkt-tab.is-on,
body.desk-shell .tab.on {
  background: #000 !important;
  color: #2B7FFF !important;
  border-color: #2B7FFF !important;
}
body.desk-shell .action-card-title { color: #E8E8E8 !important; }
body.desk-shell .action-card-body,
body.desk-shell .action-card-ids { color: #8A8A8A !important; }
body.desk-shell .pill-status.missing,
body.desk-shell .pill-status.past { color: #8A8A8A !important; }

/* Mobile + desktop: same thread chrome. Beat earlier max-width white rows. */
@media (max-width: 860px) {
  body.desk-shell .imsg-head,
  body.desk-shell.conv-view .imsg-head,
  body.desk-shell .pkt-live-head,
  body.desk-shell .jobfile-head,
  body.desk-shell .empty-state,
  body.desk-shell .live-row-empty,
  body.desk-shell .mobile-more-head,
  body.desk-shell .mobile-command,
  body.desk-shell .live-row,
  body.desk-shell .imsg-row,
  body.desk-shell .list-row,
  body.desk-shell .pkt {
    background: #000 !important;
    background-color: #000 !important;
    color: #E8E8E8 !important;
  }
  body.desk-shell .live-row,
  body.desk-shell .imsg-row,
  body.desk-shell .list-row,
  body.desk-shell .pkt {
    background: #0A0A0A !important;
  }
  body.desk-shell .live-main .name,
  body.desk-shell .imsg-row .name,
  body.desk-shell .mobile-more-head h2 {
    color: #E8E8E8 !important;
    background: transparent !important;
  }
  body.desk-shell .live-main .meta,
  body.desk-shell .imsg-preview,
  html[data-hc="1"] body.desk-shell .live-main .meta,
  html[data-hc="1"] body.desk-shell .imsg-preview {
    color: #8A8A8A !important;
  }
  body.desk-shell .mobile-desk-chips,
  body.desk-shell.fb-desk-widget-open .fb-desk-widget-win .mobile-desk-chips {
    background: #000 !important;
  }
}

/* KEEP WHITE — estimate / invoice / receipt letterhead + print paper only */
body.desk-shell .doc-ws-main-card,
body.desk-shell .doc-ws-main-card h1,
body.desk-shell .doc-ws-main-card h2,
body.desk-shell .doc-ws-main-card h3,
body.desk-shell .doc-ws-main-card label,
body.desk-shell .doc-line,
body.desk-shell .doc-ws-preview,
body.desk-shell .doc-ws-preview iframe,
body.desk-shell.mobile-doc-mode .doc-ws-main-card,
html.mobile-doc-mode .doc-ws-main-card {
  background: #fff !important;
  color: #0F172A !important;
}

/* v506: v503/v504 GRID neutralized. James stack last-wins at end of file. */
@media (min-width: 861px) {
.live-leads,
#liveLeads,
[data-leads],
.live-desk .live-section-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  position: relative !important;
  width: min(100%, 520px) !important;
  margin: 0 auto !important;
  overflow: visible !important;
}
.live-leads > *,
.job-card,
[data-lead-row],
.live-desk .live-section-list > .live-row:not(.live-row-empty):not(.empty-state),
.live-desk .live-section-list > .live-job-card,
.live-desk .live-section-list > .list-row,
.live-job-card {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  margin: 0 !important;
  float: none !important;
  width: 100% !important;
  min-height: 96px !important;
  height: auto !important;
  padding: 14px 16px !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 10px !important;
  background: #0A0A0A !important;
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 4px !important;
  justify-content: center !important;
  align-items: stretch !important;
  overflow: hidden !important;
}
}

/* v506: inner lines flow in the column stack. No absolute, no contents, no nested grid. */
@media (min-width: 861px) {
  .live-desk .live-job-card .name,
  .live-desk .live-row .name,
  .live-desk .live-job-card .addr,
  .live-desk .live-job-card .meta,
  .live-desk .live-row .meta,
  .live-desk .live-job-card .live-when,
  .live-desk .live-row .live-when,
  .live-desk .live-job-card .lead-name,
  .live-desk .live-job-card .lead-addr,
  .live-desk .live-job-card .lead-meta,
  .live-desk [data-lead-row] .lead-name,
  .live-desk [data-lead-row] .lead-addr,
  .live-desk [data-lead-row] .lead-meta,
  .live-desk [data-lead-row] .name,
  .live-desk [data-lead-row] .addr,
  .live-desk [data-lead-row] .live-when {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    display: block !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .live-desk .live-job-card .meta,
  .live-desk .live-job-card .lead-cell-name,
  .live-desk .live-job-card .live-main {
    display: block !important; /* kill display:contents / nested grid */
  }
  .live-desk .live-section-list > .live-row > *,
  .live-desk .live-job-card > * {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    grid-column: auto !important;
    grid-row: auto !important;
    display: block !important;
    min-width: 0;
    overflow: hidden;
  }
}

/* v506 LAST-WINS: Desktop Live leads. Kill GRID. Vertical stack. James exact + real DOM selectors. */
@media (min-width: 861px) {
.live-leads,
#liveLeads,
[data-leads],
.live-desk .live-section-list {
  width: min(100%, 520px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.job-card,
[data-lead-row],
.live-desk .live-job-card,
.live-desk .live-section-list > .live-row:not(.live-row-empty):not(.empty-state) {
  position: relative !important;
  width: 100%;
  min-height: 96px !important;
  height: auto !important;
  padding: 14px 16px;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  background: #0A0A0A;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  transform: none !important;
  grid-template-columns: none !important;
}
.job-card .lead-name,
.live-job-card .lead-name,
[data-lead-row] .lead-name {
  font-size: 15px;
  line-height: 1.25 !important;
  color: #fff;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  display: block !important;
}
.job-card .lead-addr,
.live-job-card .lead-addr,
[data-lead-row] .lead-addr {
  font-size: 13px;
  line-height: 1.25 !important;
  color: #8A8A8A;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  display: block !important;
}
.job-card .lead-meta,
.live-job-card .lead-meta,
[data-lead-row] .lead-meta {
  font-size: 12px;
  line-height: 1.25 !important;
  color: #8A8A8A;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  display: block !important;
}
}

/* v507: /bin/lead slim row. One name, one address, Delete. Live desk untouched. */
.lead-copy { display:flex; flex-direction:column; gap:4px; }

.pkt-list [data-lead-row],
body.desk-shell .pkt-list [data-lead-row],
body.desk-shell.bin-lead .pkt-list .pkt.list-row[data-lead-row],
body.bin-lead .pkt-list [data-lead-row] {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  position: relative !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
  float: none !important;
  transform: none !important;
}

.pkt-list [data-lead-row] .lead-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.pkt-list [data-lead-row] .lead-name,
.pkt-list [data-lead-row] .lead-addr,
.pkt-list [data-lead-row] .lead-meta,
.pkt-list [data-lead-row] .name,
.pkt-list [data-lead-row] .meta,
body.bin-lead .pkt-list [data-lead-row] .lead-name,
body.bin-lead .pkt-list [data-lead-row] .lead-addr,
body.bin-lead .pkt-list [data-lead-row] .lead-meta,
body.bin-lead .pkt-list [data-lead-row] .name,
body.bin-lead .pkt-list [data-lead-row] .meta {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  display: block !important;
  line-height: 1.25 !important;
  grid-column: auto !important;
  grid-row: auto !important;
  float: none !important;
}

.pkt-list [data-lead-row] .pkt-del,
body.bin-lead .pkt-list [data-lead-row] .pkt-del {
  flex: 0 0 auto;
  align-self: center;
  position: relative !important;
  z-index: 4;
}

.leads-page { max-width: 520px; }
.lead-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 88px; padding: 12px 14px; margin: 0 0 10px;
  background: #0A0A0A; border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  position: relative; transform: none;
}
.lead-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lead-copy .n { color: #fff; font-size: 15px; display: block; position: relative; transform: none; }
.lead-copy .a, .lead-copy .s { color: #8A8A8A; font-size: 13px; display: block; position: relative; transform: none; }

/* v510: packet is one column. Do not restyle the leads list. */
body.desk-shell.pkt-view #app,
body.desk-shell.pkt-view #app.main-stage,
body.desk-shell.pkt-view #app.stage-md,
body.pkt-view #app {
  display: block !important;
  grid-template-columns: none !important;
}
body.desk-shell.pkt-view .stage-list,
body.desk-shell.pkt-view .stage-detail,
body.desk-shell.pkt-view #stageDetail,
body.desk-shell.pkt-view .leads-page,
body.desk-shell.pkt-view #leadsList {
  display: none !important;
}
@media (min-width: 1280px) {
  body.desk-shell.pkt-view .main-stage.stage-md .stage-detail,
  body.desk-shell.pkt-view .main-stage.stage-md .stage-split {
    display: none !important;
    grid-template-columns: none !important;
  }
}
