/* New layout shell. Only applies while body.hub-v12 is on.
   Colors come from css/hub-v12-tokens.css: navy menu and header, blue for
   anything you can act on, red only for alerts. There is one accent (blue). */

body.hub-v12 #tabNav,
body.hub-v12 .setup-panel,
body.hub-v12 #hubPlaces,
body.hub-v12 #hubLayoutBtn,
body.hub-v12 #whoami,
body.hub-v12 #logoutBtn,
body.hub-v12 #navCollapseBtn {
  display: none !important;
}

body.hub-v12 .sidebar.nav-rail {
  /* Wins over body.hub-new .sidebar { display: none }, which hid this menu
     on desktops that still had the older places layout stored. */
  display: flex !important;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

body.hub-v12 button.primary {
  background: var(--v12-accent);
  border-color: var(--v12-accent);
}
body.hub-v12 button.primary:hover { background: var(--v12-accent-d); }

#hubV12Nav { display: none; padding: 4px 8px 12px; }
body.hub-v12 #hubV12Nav { display: block; }

.v12-cat {
  margin: 2px 0 6px;
  border: 0;
}
.v12-cat > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 650;
}
.v12-cat > summary::-webkit-details-marker { display: none; }
.v12-cat > summary:hover { background: var(--sidebar-bg-hover); color: #fff; }
.v12-chev {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: .7;
}
.v12-cat[open] > summary .v12-chev { transform: rotate(45deg); }
.v12-item, .v12-back, .v12-tool {
  display: flex;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: 7px 10px 7px 18px;
  font-size: 13.5px;
  cursor: pointer;
}
.v12-item:hover, .v12-back:hover, .v12-tool:hover {
  background: var(--sidebar-bg-hover);
  color: #fff;
}
.v12-item.on {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 650;
}
.v12-item.v12-blue { color: var(--hub-action-line); }
.v12-item.v12-blue.on { color: #fff; }
.v12-office { margin-bottom: 1rem; }
.v12-office textarea { width: 100%; margin-top: .35rem; }
/* Check scanner: the shared slim header and the local app at full width
   (css/hub.css has the layout; this recolours it with tokens). */
body.hub-v12 .cs-embed-title { color: var(--hub-ink); }
body.hub-v12 .cs-embed-chip { background: var(--hub-navy-l); color: var(--hub-navy); border-color: var(--hub-line); }
body.hub-v12 .cs-embed-chip[data-state="on"] { background: var(--hub-done-l); color: var(--hub-done); border-color: var(--hub-line); }
body.hub-v12 .cs-embed-chip[data-state="off"] { background: var(--hub-alert-l); color: var(--hub-alert); border-color: var(--hub-line); }
body.hub-v12 .cs-embed-link { color: var(--hub-action); }
body.hub-v12 .cs-embed-msg { color: var(--hub-ink-muted); }
body.hub-v12 .cs-embed-iframe {
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius-card);
  background: var(--hub-surface);
}
.v12-scan-popout { font-size: 12px; color: var(--hub-action); white-space: nowrap; }
.v12-tools {
  display: flex;
  gap: 8px;
  padding: 4px 8px 8px;
}
.v12-tool { width: auto; padding: 4px 8px; font-size: 12px; color: var(--sidebar-muted); }
#hubV12Back { display: none; }
body.hub-v12 #hubV12Back {
  display: flex;
  flex: none;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.v12-back {
  margin-top: 0;
  color: var(--hub-on-navy-muted);
  font-weight: 650;
  padding: 12px 14px;
  background: var(--sidebar-bg);
}

.v12-user {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  color: var(--ink);
}
body.hub-v12 .v12-user { display: flex; }
.v12-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hub-navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.v12-user b { display: block; font-size: 13px; line-height: 1.1; }
.v12-user small { color: var(--muted-ink); font-size: 11px; }

.v12-menu {
  display: none;
  position: absolute;
  right: 16px;
  top: 58px;
  width: 260px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(20, 30, 50, .14);
  padding: 8px;
  z-index: 40;
}
.v12-menu.show { display: block; }
.v12-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.v12-menu .who small { display: block; color: var(--muted-ink); }
.v12-menu button {
  display: flex;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
}
.v12-menu button:hover { background: var(--shell); }
.v12-menu button.hl { color: var(--v12-accent); font-weight: 700; }
.v12-menu button.v12-kai { background: var(--v12-accent); color: #fff; font-weight: 700; margin-top: 6px; }
.v12-menu button.v12-kai:hover { background: var(--v12-accent); filter: brightness(1.08); }
.kai-pop { position: fixed; inset: 0; z-index: 70; background: rgba(18, 26, 45, .35); display: flex; align-items: center; justify-content: center; padding: 16px; }
.kai-box { background: var(--hub-surface); color: var(--ink); border-radius: 12px; width: min(440px, 100%); padding: 18px; box-shadow: 0 12px 40px rgba(0, 0, 0, .2); }
.kai-box h3 { margin: 0 0 .3rem; }
.kai-box p { margin: .3rem 0; }
.kai-box textarea { width: 100%; min-height: 96px; font: inherit; font-size: 13px; border: 1px solid var(--hub-line); border-radius: 6px; padding: 6px 8px; margin: .4rem 0; }
.kai-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.kai-on { display: inline-block; background: var(--hub-done-l); color: var(--hub-done); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.kai-err { color: var(--hub-alert); }

.v12-pop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 26, 45, .35);
  display: flex;
  justify-content: flex-end;
}
.v12-sheet {
  width: min(440px, 100%);
  height: 100%;
  background: #fff;
  padding: 22px 22px 32px;
  overflow: auto;
  box-shadow: -12px 0 40px rgba(20, 30, 50, .12);
}
.v12-sheet h2 { margin: 0 0 6px; }
.v12-accents { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.v12-swatch {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
}
.v12-swatch.on { border-color: var(--v12-accent); background: var(--v12-accent-l); }
.v12-dot { width: 14px; height: 14px; border-radius: 50%; }

.v12-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0 0 12px; }
.v12-filters input, .v12-filters select { max-width: 200px; }
.v12-old { color: var(--hub-wait); text-decoration: line-through; }
.v12-new { color: var(--hub-done); font-weight: 650; }
.v12-note { font-size: 13px; color: var(--muted-ink); }

.v12-layout-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.v12-layout-row b { min-width: 8rem; }

.v12-page h1 { margin: 0 0 8px; font-size: 1.6rem; }
.v12-hero { padding: 8px 0 12px; }
.v12-ask { display: flex; gap: 8px; align-items: center; }
.v12-ask input { flex: 1; font-size: 16px; padding: 12px 14px; }
.v12-ask button, #v12Mic {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}
#v12Mic.on { background: var(--v12-accent); color: #fff; border-color: var(--v12-accent); }
.v12-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.v12-results button, .v12-chip, .v12-link {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.v12-results button small, .v12-urgent-item small { display: block; color: var(--muted-ink); font-size: 12px; }
.v12-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.v12-chip { border-radius: 999px; }
.v12-urgent {
  background: var(--hub-alert);
  color: #fff;
  border-radius: 12px;
  padding: 0;
  margin: 0 0 12px;
}
.v12-urgent-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.v12-urgent-head b {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v12-urgent-count {
  flex: none;
  min-width: 1.5em;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.v12-urgent-chevron { flex: none; display: block; transition: transform .15s ease; }
.v12-urgent.is-open > .v12-urgent-head .v12-urgent-chevron { transform: rotate(90deg); }
.v12-urgent-list { padding: 0 10px 8px; }
.v12-urgent-list[hidden] { display: none; }
.v12-urgent-group { margin-top: 6px; }
.v12-urgent-group-head,
.v12-urgent-vendor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(0,0,0,.18);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.v12-urgent-vendor-head { background: rgba(255,255,255,.08); }
.v12-urgent-group-head b,
.v12-urgent-vendor-head b {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v12-urgent-group-head small,
.v12-urgent-vendor-head small {
  flex: 1 1 100%;
  min-width: 0;
  color: rgba(255,255,255,.85);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v12-urgent-amount {
  flex: none;
  font-size: 13px;
  font-weight: 700;
}
.v12-urgent-group.is-open > .v12-urgent-group-head .v12-urgent-chevron,
.v12-urgent-vendor.is-open > .v12-urgent-vendor-head .v12-urgent-chevron { transform: rotate(90deg); }
.v12-urgent-group-body,
.v12-urgent-vendor-body { padding: 0 0 2px 8px; }
.v12-urgent-group-body[hidden],
.v12-urgent-vendor-body[hidden] { display: none; }
.v12-urgent-vendor { margin-top: 6px; }
.v12-urgent-item {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: left;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.v12-urgent-item small { color: rgba(255,255,255,.85); }
body.hub-v12 .card.v12-open,
body.hub-v12 tr.v12-open,
body.hub-v12 .v12-queue small.v12-open {
  outline: 2px solid var(--v12-accent);
  outline-offset: 2px;
}
.v12-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.v12-box { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 12px; }
.v12-box.wide { grid-column: 1 / -1; }
.v12-box header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.v12-fold { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.v12-box.folded .v12-box-body { display: none; }
.v12-lines { margin: 8px 0 0; padding-left: 18px; }
.v12-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.v12-lock { font-size: 13px; color: var(--hub-wait); }
.v12-preview {
  background: var(--hub-wait-l);
  border: 1px solid var(--hub-wait);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.v12-editor { margin: 8px 0 12px; }
.v12-sync {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.v12-sync.offline, .v12-sync.failed { background: var(--hub-alert-l); color: var(--hub-alert); }
.v12-sync.waiting { background: var(--hub-wait-l); color: var(--hub-wait); }
body.hub-v12.v12-phone:not(.field-face) #v12PhoneBar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(20, 30, 50, .06);
  padding: 0 0 env(safe-area-inset-bottom);
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneBar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  min-width: 0;
  min-height: 62px;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.15;
  padding: 4px 2px;
  cursor: pointer;
  color: var(--hub-ink-muted);
  box-shadow: none;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneBar button span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneBar[data-n="6"] button {
  font-size: 11px;
  padding: 4px 0;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneBar[data-n="6"] .v12-ico {
  width: 22px;
  height: 22px;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneBar button.on {
  color: var(--v12-accent);
  font-weight: 650;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneBar button.on::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24%;
  right: 24%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--v12-accent);
}
.v12-phone-badge {
  position: absolute;
  top: 6px;
  left: calc(50% + 6px);
  background: var(--hub-alert);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  line-height: 1;
}
.v12-ico {
  width: 24px;
  height: 24px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.hub-v12.v12-phone:not(.field-face) #mainContent {
  padding: calc(68px + env(safe-area-inset-top)) 12px calc(108px + env(safe-area-inset-bottom));
  max-width: 100%;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
/* The menu is an overlay. It must not keep a column while it is shut.
   The maintenance phone (field-face) keeps its own bar. */
body.hub-v12.v12-phone:not(.field-face) .sidebar {
  display: flex !important;
  position: fixed;
  z-index: 70;
  left: 0; top: 0; bottom: 0;
  width: min(288px, 88vw);
  max-width: 88vw;
  transform: translateX(-105%);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  box-shadow: none;
}
body.hub-v12.v12-phone:not(.field-face) .sidebar.open {
  transform: translateX(0);
  box-shadow: 15px 0 40px #16213b22;
}
body.hub-v12.v12-phone #scrim { z-index: 65; }
body.hub-v12.v12-phone:not(.field-face) #fieldNav,
body.hub-v12.v12-phone:not(.field-face) #fieldMenuBtn { display: none !important; }
body.hub-v12.v12-phone:not(.field-face) .hub {
  display: block !important;
  height: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template: none;
  grid-template-columns: none;
}
body.hub-v12.v12-phone:not(.field-face) .content { width: 100%; max-width: 100%; min-width: 0; }
body.hub-v12.v12-phone.field-face .sidebar,
body.hub-v12.v12-phone.field-face .hamb,
body.hub-v12.v12-phone.field-face #teamChatRail { display: none !important; }
#v12More { position: fixed; inset: 0; z-index: 50; background: rgba(18, 26, 45, .35); }
.v12-more-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 80vh; overflow: auto;
  background: #fff; border-radius: 16px 16px 0 0; padding: 12px 12px 28px;
}
.v12-more-sheet header { display: flex; justify-content: space-between; align-items: center; }
.v12-more-sheet h3 { margin: 14px 0 6px; font-size: 13px; color: var(--muted-ink); }
.v12-more-sheet button {
  display: block; width: 100%; text-align: left;
  border: 0; background: none; padding: 10px 8px; border-radius: 8px; cursor: pointer;
}
.v12-more-sheet button:hover { background: var(--shell); }
.v12-heavy {
  position: relative;
  z-index: 5;
  background: #fff;
  padding: 12px 0 20px;
}
body.hub-v12 .fprojects { margin: 0 0 .15rem; font-size: 1.45rem; line-height: 1.15; }
body.hub-v12.v12-phone .pj-list { flex-direction: column; overflow: visible; }
body.hub-v12.v12-phone .pj-card { min-width: 0; max-width: none; width: 100%; }
body.hub-v12.v12-phone .pj-page:has(.pj-card.on) .pj-list { display: none; }
body.hub-v12.v12-phone #tList table,
body.hub-v12.v12-phone #tList thead,
body.hub-v12.v12-phone #tList tbody,
body.hub-v12.v12-phone #tList tr,
body.hub-v12.v12-phone #tList td { display: block; width: auto; }
body.hub-v12.v12-phone #tList thead { display: none; }
body.hub-v12.v12-phone #tList tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
@media (max-width: 720px) {
  .v12-grid { grid-template-columns: 1fr; }
}

.v12-askpanel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 40px rgba(20, 30, 50, .16);
  padding: 18px 18px 28px;
  overflow: auto;
}
.v12-queue, .v12-billrule, .v12-wait {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  background: #fff;
}
.v12-queue { background: var(--hub-wait-l); }
.v12-queue b, .v12-queue span, .v12-queue small { display: block; }
.v12-queue small { color: var(--hub-alert); }
.v12-wait { background: var(--hub-wait-l); }
.v12-lanes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.v12-lane h3 { font-size: 14px; margin: 0 0 8px; }
.v12-photo, .v12-kind, .v12-file {
  display: block;
  margin: 6px 0;
}
.v12-photo small { display: block; color: var(--muted-ink); }
.v12-photo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.v12-file input { display: block; margin-top: 4px; }
.v12-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--shell);
  font-size: 12px;
}
@media (max-width: 900px) {
  .v12-lanes { grid-template-columns: 1fr; }
}

/* Phone shell for the new layout only. The desktop header is hidden.
   This bar is the mockup's own: logo or back, the page title, the sync
   pill, and the avatar. Staff without body.hub-v12 keep their header. */
#v12PhoneTop { display: none; }
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 46;
  box-sizing: border-box;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: var(--hub-ink);
  color: #fff;
  align-items: center;
  gap: 6px;
}
#v12PhoneTop[hidden] { display: none !important; }
.v12-phone-logo {
  width: 36px;
  height: 36px;
  margin: 0 4px;
  border-radius: 10px;
  background: var(--v12-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12.5px;
  flex: none;
}
.v12-phone-logo[hidden],
.v12-phone-back[hidden] { display: none !important; }
.v12-phone-back {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.v12-phone-back .v12-ico { width: 22px; height: 22px; transform: rotate(180deg); }
.v12-phone-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.2px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-sync {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  height: 44px;
  max-width: 132px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 22px;
  background: var(--hub-ink);
  color: var(--hub-done-l);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.1;
  text-indent: 0;
  overflow: hidden;
  flex: none;
  cursor: pointer;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-sync span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-sync .v12-ico {
  width: 17px;
  height: 17px;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-sync.wait,
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-sync.waiting {
  background: var(--hub-ink);
  color: var(--hub-wait-l);
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-sync.off,
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-sync.offline,
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-sync.failed {
  background: var(--hub-alert);
  color: #fff;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-user {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 2px solid #ffffff55;
  border-radius: 50%;
  background: var(--hub-navy);
  color: #fff;
  justify-content: center;
  gap: 0;
  flex: none;
}
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-user > span:not(.v12-av) { display: none !important; }
body.hub-v12.v12-phone:not(.field-face) #v12PhoneTop .v12-av {
  width: 40px;
  height: 40px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.v12-phone-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hub-alert);
  border: 2px solid var(--hub-ink);
}
body.hub-v12.v12-phone:not(.field-face) .v12-menu {
  position: fixed;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  width: 100%;
  max-height: min(80vh, 560px);
  overflow: auto;
  border-radius: 16px 16px 0 0;
  z-index: 80;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
body.hub-v12.v12-phone .v12-menu button { min-height: 44px; }
body.hub-v12.v12-phone:not(.field-face):not(.hub-side-open) #teamChatRail {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
}
body.hub-v12.v12-phone:not(.field-face) main#mainContent { padding-right: 12px !important; }
body.hub-v12.v12-phone.hub-side-open #teamChatRail {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: min(86vh, 720px);
  z-index: 60;
  background: #fff;
  color: var(--ink);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .2);
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
body.hub-v12.v12-phone.hub-side-open #teamChatRail .hub-todo,
body.hub-v12.v12-phone.hub-side-open #teamChatRail .hub-side-lower {
  display: flex !important;
}
body.hub-v12.v12-phone.hub-side-open .hub-side-icons { display: none !important; }
#v12RailScrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  border: 0;
  background: rgba(18, 26, 45, .35);
  cursor: pointer;
}
#v12RailScrim[hidden] { display: none !important; }
#v12RailClose { display: none; }
body.hub-v12.v12-phone.hub-side-open #v12RailClose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 8;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}
body.hub-v12.v12-phone .hub-coach-btn {
  bottom: calc(78px + env(safe-area-inset-bottom));
  right: 12px;
  z-index: 44;
}
body.hub-v12.v12-phone .hub-coach-panel {
  right: 12px;
  bottom: calc(136px + env(safe-area-inset-bottom));
  width: min(22rem, calc(100vw - 24px));
}
body.hub-v12.v12-phone #hubVersionChip {
  left: 8px !important;
  right: auto !important;
  bottom: calc(78px + env(safe-area-inset-bottom)) !important;
}
body.hub-v12.v12-phone .v12-page,
body.hub-v12.v12-phone .v12-hero,
body.hub-v12.v12-phone .v12-ask,
body.hub-v12.v12-phone .v12-chips,
body.hub-v12.v12-phone .v12-urgent,
body.hub-v12.v12-phone .v12-grid,
body.hub-v12.v12-phone .v12-box { min-width: 0; max-width: 100%; }
body.hub-v12.v12-phone .v12-hero h1 { font-size: 1.3rem; margin: 0 0 10px; }
body.hub-v12.v12-phone .v12-ask {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}
body.hub-v12.v12-phone .v12-ask input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  font-size: 16px;
}
body.hub-v12.v12-phone #v12Mic {
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 44px;
  padding: 0 14px;
}
body.hub-v12.v12-phone .v12-chip {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}
body.hub-v12.v12-phone .v12-urgent {
  padding: 0;
  margin: 0 0 10px;
}
body.hub-v12.v12-phone .v12-urgent-head { height: 44px; min-height: 44px; max-height: 44px; }
body.hub-v12.v12-phone .v12-urgent-head b { font-size: 14px; }
body.hub-v12.v12-phone .v12-urgent-item {
  margin-top: 6px;
  min-height: 44px;
  padding: 8px 10px;
}
body.hub-v12.v12-phone .v12-urgent-item small,
body.hub-v12.v12-phone .v12-urgent-group-head small,
body.hub-v12.v12-phone .v12-urgent-vendor-head small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.hub-v12.v12-phone .v12-urgent-group-head,
body.hub-v12.v12-phone .v12-urgent-vendor-head { min-height: 44px; }
body.hub-v12.v12-phone .v12-grid { grid-template-columns: minmax(0, 1fr); }
body.hub-v12.v12-phone .v12-foot { gap: 8px; }
body.hub-v12.v12-phone .v12-foot .secondary,
body.hub-v12.v12-phone .v12-foot .v12-link { min-height: 44px; }
body.hub-v12.v12-phone .v12-more-sheet {
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
body.hub-v12.v12-phone .v12-more-sheet button { min-height: 48px; }

@media (min-width: 561px) and (max-width: 900px) {
  body.hub-v12:not(.v12-phone) .topbar .hub-search { min-width: 0; max-width: 16rem; }
  body.hub-v12:not(.v12-phone) .brand {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.hub-v12:not(.v12-phone) .top-actions { min-width: 0; }
}
@media (min-width: 561px) and (max-width: 1099px) {
  body.hub-v12.hub-side-collapsed:not(.field-face) .hub-coach-btn {
    right: calc(var(--side-rail) + 14px);
  }
}

/* Maintenance and vendor phones keep the field bar. These undo the office
   phone header and the tasks panel so that screen is not restyled. */
body.hub-v12.v12-phone.field-face .hamb,
body.hub-v12.v12-phone.field-face .sidebar,
body.hub-v12.v12-phone.field-face #teamChatRail,
body.hub-v12.field-face #v12PhoneTop,
body.hub-v12.field-face #v12PhoneBar { display: none !important; }
body.hub-v12.v12-phone.field-face .v12-phone-title { display: none !important; }
body.hub-v12.v12-phone.field-face .topbar {
  display: grid !important;
  grid-template-columns: 1fr auto;
  min-height: 64px;
  padding: 0;
}
body.hub-v12.v12-phone.field-face .brandwrap { display: flex !important; }
body.hub-v12.v12-phone.field-face .topbar .hub-search { display: block !important; }
body.hub-v12.v12-phone.field-face .topbar .hub-lang { display: flex !important; }
body.hub-v12.v12-phone.field-face #pwaInstall { display: inline-block !important; }
body.hub-v12.v12-phone.field-face .v12-user {
  order: 0;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  background: #fff;
  gap: 8px;
}
body.hub-v12.v12-phone.field-face .v12-user > span:not(.v12-av) { display: block !important; }
body.hub-v12.v12-phone.field-face .v12-sync {
  order: 0;
  width: auto;
  height: auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  overflow: visible;
  text-indent: 0;
  font-size: 12px;
  line-height: 1.2;
  color: inherit;
  background: #fff;
}

.v12-chip-mark {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 5px;
  opacity: .85;
}
.v12-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sidebar-muted);
  font-size: 11px;
  padding: 2px 12px 6px;
}
.v12-nd {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hub-action-line);
  display: inline-block;
}
.v12-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.v12-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.v12-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  text-align: left;
  color: inherit;
  font: inherit;
}
button.v12-stat { cursor: pointer; width: 100%; }
button.v12-stat.on { border-color: var(--v12-accent); background: var(--v12-accent-l); }
.v12-stat b { display: block; font-size: 1.15rem; }
.v12-stat span, .v12-stat small, .v12-listbtn span {
  display: block;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 500;
}
.v12-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.v12-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}
.v12-tabs button.on { background: var(--v12-accent); color: #fff; border-color: var(--v12-accent); }
.v12-split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: 12px; }
.v12-lines { margin: 0; padding-left: 1.1rem; }
.v12-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--shell);
  font-size: 12px;
}
.v12-syncbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--hub-action-line);
  background: var(--hub-action-l);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.v12-kindrow { display: flex; flex-wrap: wrap; gap: 8px; }
.v12-kindrow .v12-stat { flex: 1; min-width: 140px; }
.v12-preview, .v12-placeholder {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--hub-canvas);
}
.v12-placeholder dt { font-size: 12px; color: var(--muted-ink); }
.v12-placeholder dd { margin: 0 0 8px; }
.v12-listbtn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 8px;
  cursor: pointer;
}
.v12-listbtn.on { border-color: var(--v12-accent); background: var(--v12-accent-l); }
body.hub-v12 tr.v12-berkeley td { background: var(--hub-action-l); }
body.hub-v12 tr.v12-berkeley td:first-child { font-weight: 700; color: var(--hub-action-d); }
.v12-berkeley-form { margin-top: 12px; }
.v12-quick { display: none; }
.v12-money { margin-top: 12px; }

/* View as: fixed to the top of the screen, above every page, sheet and
   overlay (Field View included) but under the confirm dialog, so Exit is
   always on screen. The page moves down by the bar's height. */
.v12-viewas {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1150;
  padding-top: max(10px, env(safe-area-inset-top));
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--hub-wait);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
}
.v12-viewas-text { flex: 1 1 220px; }
.v12-viewas button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--hub-wait);
  font-weight: 750;
  padding: 0 12px;
  cursor: pointer;
}
.v12-viewas-device { display: inline-flex; gap: 4px; background: rgba(255,255,255,.18); border-radius: 12px; padding: 3px; }
.v12-viewas-device button { background: transparent; color: #fff; }
.v12-viewas-device button.on { background: #fff; color: var(--hub-wait); }
.v12-view-picks { display: flex; flex-direction: column; gap: 8px; }
.v12-view-picks button {
  text-align: left;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
body.v12-viewing { padding-top: var(--v12-viewas-h, 64px); }
body.hub-v12.v12-viewing.v12-phone:not(.field-face) #v12PhoneTop,
body.v12-viewing #v12PhoneTop,
body.v12-viewing .topbar,
body.v12-viewing .v12-askpanel { top: var(--v12-viewas-h, 64px); }
@media (min-width: 420px) {
  /* Inside the phone preview frame (a wide screen) the frame itself
     scrolls, so the bar sticks to the top of the frame instead. */
  body.hub-v12.v12-viewing.v12-view-frame { padding-top: 0; }
  body.hub-v12.v12-view-frame .v12-viewas { position: sticky; }
  body.hub-v12.v12-view-frame {
    width: 390px;
    height: 100vh;
    overflow: auto;
    margin: 0 auto;
    background: var(--hub-canvas);
    box-shadow: 0 0 0 12px var(--hub-ink);
    transform: translateZ(0);
  }
}
html:has(body.v12-view-frame) { background: var(--hub-navy); }

body.hub-v12.v12-phone .v12-phone-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
body.hub-v12.v12-phone .v12-phone-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  font-weight: 650;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
body.hub-v12.v12-phone .v12-phone-tile .v12-ico {
  width: 22px;
  height: 22px;
  color: var(--v12-accent);
  flex: none;
}
body.hub-v12.v12-phone .v12-urgent-head b,
body.hub-v12.v12-phone .v12-urgent-count {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.hub-v12.v12-phone .v12-home-set {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 18px;
  padding: 0 12px 10px;
}
body.hub-v12.v12-phone .v12-home-set summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 650;
  cursor: pointer;
}
body.hub-v12.v12-phone .v12-home-set .secondary,
body.hub-v12.v12-phone .v12-home-set .v12-link { min-height: 44px; }
body.hub-v12.v12-phone .hub-coach-btn,
body.hub-v12.v12-phone #hubVersionChip,
body.hub-v12.v12-phone #hubReportBtn { display: none !important; }
body.hub-v12.v12-phone .v12-hero h1 { font-size: 26px; letter-spacing: -.3px; }

/* Name menu: the version next to "Check for updates". */
.v12-menu .v12-menu-ver { margin-left: auto; padding-left: 8px; font-size: 12px; color: var(--hub-ink-muted); }
