:root {
  --bg: #f3f3f3;
  --bg-elev: #ffffff;
  --bg-2: #f6f6f6;
  --bg-3: #ececec;
  --line: #dcdcdc;
  --line-strong: #c8c8c8;
  --text: #161616;
  --muted: #6a6a6a;
  --faint: #9a9a9a;
  --fill: #e8e8e8;
  --fill-2: #dedede;
  --ok: #222;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --pad: 12px;
  --board-cols: 20;
  --cell-h: 92px;
  --gap: 10px;
  --widget-pad: 8px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  height: 100%;
  height: 100svh;
  max-height: 100svh;
  margin: 0;
  overflow: hidden;
}
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}
button, input, textarea, select {
  font: inherit; color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg-3);
  border-radius: 9px;
  padding: 6px 10px;
}
button:hover { background: var(--fill-2); }
button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #888; outline-offset: 2px;
}
select, input[type="number"] {
  border: 1px solid var(--line); background: var(--bg-elev);
  border-radius: 8px; padding: 4px 6px;
}
svg-icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
}
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
}
.icon-btn svg-icon { width: 18px; height: 18px; }
.tabs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0;
}
.tab {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--bg-2);
  border-radius: 999px; padding: 4px 12px; font-size: 12px;
  cursor: pointer; user-select: none;
}
.tab.on { background: var(--bg-elev); border-color: #888; color: var(--text); box-shadow: var(--shadow-sm); }
.app {
  height: 100%;
  height: 100svh;
  max-height: 100svh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 8px 10px;
  gap: 6px;
  overflow: hidden;
}
button.top {
  display: flex; align-items: center;
  gap: 10px; flex-wrap: nowrap;
  width: 100%;
  padding: 3px 10px 3px 6px;
  min-height: 34px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
button.top:hover { background: var(--bg-elev); }
button.top:active { background: var(--fill-2); }
.mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, #4a4a4a, #d8d8d8);
  color: #111; display: grid; place-items: center; font-weight: 800;
  font-size: 13px; line-height: 1;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}
.who {
  display: flex; align-items: center; gap: 6px;
  min-width: 0; flex: 1;
  font-size: 12px; white-space: nowrap; overflow: hidden;
}
.who-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.who-sep { color: var(--faint); flex: 0 0 auto; }
.who-phone, .who-email { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.desk-line {
  display: flex; align-items: center; gap: 6px;
  flex: 0 0 auto; font-size: 12px; color: var(--muted);
  white-space: nowrap;
}
.desk-line .k {
  text-transform: uppercase; letter-spacing: .05em;
  font-size: 10px; font-weight: 700; color: var(--faint);
}
.chip {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted);
  border-radius: 999px; padding: 4px 10px; font-size: 12px;
}
.chip.on { color: var(--text); border-color: #888; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.shell {
  position: relative;
  min-height: 0;
  display: flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg-elev);
}
.board {
  position: relative;
  flex: 0 0 42%;
  min-width: 280px;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.split-gutter {
  position: relative;
  flex: 0 0 6px;
  align-self: stretch;
  overflow: visible;
  z-index: auto;
}
.split {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: col-resize; background: var(--line);
  transition: background .15s ease;
}
.split:hover, .split.dragging { background: #999; }
.split-collapse {
  position: absolute;
  top: 12px;
  z-index: 2020;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  overflow: visible;
}
.split-collapse svg-icon {
  width: 18px;
  height: 18px;
}
.split-collapse .chev-flip { display: none; }
.split-collapse[data-collapse="board"] { right: 100%; margin-right: 12px; }
.split-collapse[data-collapse="chat"] { left: 100%; margin-left: 12px; }
#boardSettingsBtn .ico-pane,
#chatSettingsBtn .ico-pane { display: none; }
.chat {
  position: relative;
  flex: 1 1 auto; min-width: 140px;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-elev);
}
@media (min-width: 861px) {
  .shell.chat-left { flex-direction: row-reverse; }
  .shell.chat-left .board {
    border-right: 0;
    border-left: 1px solid var(--line);
  }
  .board .chrome { padding-right: 56px; }
  .chat .chrome { padding-left: 56px; }
  .shell.chat-left .board .chrome { padding-right: 12px; padding-left: 56px; }
  .shell.chat-left .chat .chrome { padding-left: 12px; padding-right: 56px; }
  .shell.chat-left .split-collapse[data-collapse="board"] {
    left: 100%;
    right: auto;
    margin-left: 12px;
    margin-right: 0;
  }
  .shell.chat-left .split-collapse[data-collapse="chat"] {
    right: 100%;
    left: auto;
    margin-right: 12px;
    margin-left: 0;
  }
  .shell.chat-left .split-collapse .chev-out { display: none; }
  .shell.chat-left .split-collapse .chev-flip { display: grid; }
  .shell.collapsed-chat .split-gutter,
  .shell.collapsed-board .split-gutter { display: none; }
  .shell.collapsed-chat .chat,
  .shell.collapsed-board .board {
    position: absolute;
    top: 0;
    width: 0;
    min-width: 0;
    flex: none;
    overflow: visible;
    border: 0;
    background: transparent;
    pointer-events: none;
    z-index: 2020;
  }
  .shell.collapsed-chat .chat { right: 0; left: auto; }
  .shell.collapsed-board .board { left: 0; right: auto; }
  .shell.chat-left.collapsed-chat .chat { left: 0; right: auto; }
  .shell.chat-left.collapsed-board .board { right: 0; left: auto; }
  .shell.collapsed-chat .board,
  .shell.collapsed-board .chat {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
  }
  .shell.collapsed-board .board .chrome,
  .shell.collapsed-chat .chat .chrome {
    position: absolute;
    top: 0;
    width: max-content;
    justify-content: center;
    padding: 10px 12px;
    border-bottom: 0;
    background: transparent;
    pointer-events: none;
  }
  .shell.collapsed-board .board .chrome { left: 0; right: auto; }
  .shell.collapsed-chat .chat .chrome { right: 0; left: auto; }
  .shell.chat-left.collapsed-board .board .chrome { right: 0; left: auto; }
  .shell.chat-left.collapsed-chat .chat .chrome { left: 0; right: auto; }
  .shell.collapsed-board #boardSettingsBtn,
  .shell.collapsed-chat #chatSettingsBtn { pointer-events: auto; }
  .shell.collapsed-board .board .chrome > :not(#boardSettingsBtn),
  .shell.collapsed-chat .chat .chrome > :not(#chatSettingsBtn) { display: none; }
  .shell.collapsed-board .board .settings,
  .shell.collapsed-board .board .grid-wrap,
  .shell.collapsed-board .board .cam-controls,
  .shell.collapsed-chat .chat .settings,
  .shell.collapsed-chat .chat .messages,
  .shell.collapsed-chat .chat .hint,
  .shell.collapsed-chat .chat .composer { display: none; }
  .shell.collapsed-board #boardSettingsBtn .ico-menu,
  .shell.collapsed-chat #chatSettingsBtn .ico-menu { display: none; }
  .shell.collapsed-board #boardSettingsBtn .ico-pane,
  .shell.collapsed-chat #chatSettingsBtn .ico-pane { display: grid; }
}
.chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
  flex: 0 0 auto;
  position: relative;
  z-index: 2010;
}
.chrome h1 {
  margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.pages { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.grid-wrap {
  flex: 1; min-height: 0; overflow: hidden; padding: 12px;
  touch-action: none;
  overscroll-behavior: contain;
  cursor: grab;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
}
.grid-wrap *,
.grid-wrap *::before,
.grid-wrap *::after {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
}
.grid-wrap.is-panning { cursor: grabbing; }
.grid {
  display: grid;
  grid-template-columns: repeat(var(--board-cols), var(--cell-h));
  grid-auto-rows: var(--cell-h);
  gap: var(--gap);
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  position: relative;
  transform-origin: 0 0;
  will-change: transform;
}
.cam-controls {
  position: absolute;
  right: calc(12px + var(--vv-right, 0px));
  bottom: calc(12px + var(--vv-bottom, 0px));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cam-controls .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.cam-views { position: relative; }
.view-pop {
  position: absolute;
  right: 52px;
  bottom: 0;
  min-width: 196px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.view-pop[hidden] { display: none; }
.view-pop > button,
.view-pop .view-row > button:first-child,
.views-settings > button {
  text-align: left;
  padding: 8px 12px;
  margin: 0;
}
.view-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.view-row > button:first-child { flex: 1; text-align: left; }
.views-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
[data-view-named] {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cell {
  width: var(--cell-h);
  height: var(--cell-h);
  margin: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  position: relative;
}
.cell.hot {
  background: rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16), inset 3px 4px 8px rgba(0, 0, 0, 0.12);
}
.widget {
  position: relative;
  z-index: 1;
  grid-column: var(--x) / span var(--w);
  grid-row: var(--y) / span var(--h);
  margin: var(--widget-pad, 8px);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.widget.is-enter { animation: rise .18s ease; }
.widget.dragging {
  opacity: .92;
  z-index: 20;
  isolation: isolate;
  transform: translateZ(0);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.widget.ghost {
  pointer-events: none; outline: 2px dashed #888; background: #fafafa;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wh {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 10px; background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto; cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.wh:active { cursor: grabbing; }
.wh b { font-size: 0.92em; font-weight: 650; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh b[data-rename-title],
.card-h b[data-rename-title] { cursor: pointer; }
.x {
  width: 22px; height: 22px; padding: 0; border-radius: 7px;
  display: grid; place-items: center; color: var(--text); line-height: 1;
  background: var(--fill);
}
.x svg-icon { width: 12px; height: 12px; }
.widget { touch-action: none; }
.widget { font-size: var(--board-font, 13px); }
.wb { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px; font-size: 1em; touch-action: pan-x pan-y; overscroll-behavior: contain; }
.wb.can-scroll { cursor: grab; }
.wb.is-scrolling { cursor: grabbing; }
.resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  touch-action: none;
  cursor: nwse-resize;
  color: #c5c9d1;
  opacity: 0.82;
}
.resize:hover { opacity: 1; }
.resize svg-icon {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 76px;
  height: 76px;
  color: inherit;
  overflow: visible;
}
.row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .t { font-weight: 600; }
.row .m { color: var(--muted); font-size: 0.85em; margin-top: 2px; }
.todo-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.wq-list { display: flex; flex-direction: column; gap: 2px; }
.wq-n { color: var(--muted); margin-right: 4px; }
.wq-item .menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.todo-bucket-h {
  font-size: 0.85em;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 10px 0 4px;
}
.todo-live .m,
.lab-live .m { padding: 8px 0; }
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.92em;
}
.cal-title { flex: 1; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-live[data-calendar-root] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.lab-live[data-calendar-root] > div {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.widget[data-kind="calendar"] .wb {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card[data-kind="calendar"] .lab-live[data-calendar-root] {
  height: 260px;
}
.cal-grid { display: grid; gap: 4px; flex: 1; min-height: 0; }
.cal-cols { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.cal-month { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.cal-day {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.cal-day-pop {
  position: fixed;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  padding: 6px;
  min-width: 120px;
  max-width: 180px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.cal-day-pop[hidden] { display: none; }
.cal-day-pop-h {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  padding: 2px 10px 4px;
}
.cal-day-pop button {
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.cal-day-pop button:hover { background: var(--fill); }
.cal-today { background: var(--bg-3); }
.cal-out { opacity: .45; }
.cal-day-h { font-size: 0.85em; color: var(--muted); font-weight: 650; flex: 0 0 auto; }
.cal-day-b {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.cal-chip {
  font-size: 0.85em;
  border-left: 3px solid #8b9cb0;
  padding: 2px 4px;
  margin: 2px 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cal-more {
  position: relative;
  display: block;
  width: 100%;
  flex: 0 0 auto;
  margin: 4px 0 0;
  padding: 5px 36px 5px 8px;
  font-size: 0.77em;
  font-weight: 650;
  line-height: 1.3;
  text-align: left;
  color: var(--muted);
  background: var(--fill);
  overflow: visible;
}
.cal-dots {
  position: absolute;
  top: 50%;
  right: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}
.cal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--dot, #8b9cb0);
}
.cal-time { color: var(--muted); }
.bubble .when { font-size: 0.77em; color: var(--muted); margin-top: 4px; }
.lab-live .row { align-items: center; }
.lab-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 4px;
}
.lab-login label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.lab-login input { font: inherit; color: inherit; }
.lab-login-err { color: #8a2b2b; font-size: 12px; margin: 0; }
.lab-login .send { align-self: stretch; }
.menu { position: relative; }
.menu.open { z-index: 8; }
.menu .pop {
  display: none; position: absolute; right: 0; top: 120%;
  background: var(--bg-3); border: 1px solid var(--line-strong);
  border-radius: 10px; min-width: 140px; z-index: 5;
  box-shadow: var(--shadow);
}
.menu.open .pop {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  min-width: 168px;
}
.menu .pop button {
  flex: 1 1 calc(50% - 8px);
  border: 0;
  background: var(--bg);
  text-align: center;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.menu .pop button.danger { color: #8a2b2b; }
button.row-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
  cursor: pointer;
}
.chip-row .menu { display: inline-flex; align-items: center; }
.chip-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.widget .chip { font-size: 0.85em; }
.sms { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1; }
[data-sms-root] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.widget [data-park-search],
.card [data-park-search] {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-elev);
}
.btn {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.btn.small { padding: 5px 8px; font-size: 11px; }
.btn.primary { font-weight: 700; }
.btn.danger { color: #8a2b2b; }
.btn.call { border-color: #2f9e6b; }
.widget .wb > .card > .card-h,
.card .card-b > .card > .card-h,
.lab-live > .card > .card-h { display: none; }
.widget .wb > .card,
.card .card-b > .card {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
.contact-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.contact-row:last-child { border-bottom: none; }
.contact-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.contact-row button { pointer-events: auto; cursor: pointer; position: relative; z-index: 2; }
.contact-person .contact-actions { margin-top: 8px; }
.contact-person .meta { margin-bottom: 4px; }
.contact-compose {
  flex-basis: 100%;
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.contact-compose[hidden] { display: none !important; }
.contact-compose textarea,
.contact-compose input[type=text] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: var(--bg-elev);
}
.contact-notes { white-space: pre-wrap; margin-top: 4px; }
.contact-add { margin-top: 10px; }
.contact-edit-form {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.contact-edit-form .row2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}
.contact-edit-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.contact-edit-form .dialog-input { margin-top: 0; max-width: 100%; min-width: 0; }
.contact-edit-form textarea.dialog-input {
  min-height: 96px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.contact-edit-flags { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.contact-edit-flags .chk { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); }
.contact-edit-status { margin: 0; color: #8a2b2b; font-size: 12px; }
.task-edit-form {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.task-edit-form .row2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}
.task-edit-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.task-edit-form .chk { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); }
.task-edit-form .dialog-input { margin-top: 0; max-width: 100%; min-width: 0; }
.task-edit-form textarea.dialog-input {
  min-height: 72px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.task-edit-status { margin: 0; color: #8a2b2b; font-size: 12px; }
.task-view-form {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.task-view-dl {
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
}
.task-view-dl div { min-width: 0; }
.task-view-dl dt {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  margin: 0 0 2px;
}
.task-view-dl dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.task-view-menu {
  position: relative;
  display: inline-flex;
}
.task-view-menu .task-view-pop {
  display: flex;
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 10px);
  top: auto;
  z-index: 30;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px;
  min-width: 148px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.task-view-menu:not(.open) .task-view-pop { display: none; }
.task-view-menu .task-view-pop button {
  margin: 2px 0;
  border: 0;
  background: var(--bg);
  text-align: left;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.task-view-menu .task-view-pop button.danger { color: #8a2b2b; }
button.cal-chip {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--bg-elev, #fff);
  cursor: pointer;
  border: none;
  border-left: 3px solid #8b9cb0;
  padding: 2px 4px;
}
.cc-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.cc-status { font-size: 11px; color: var(--muted); margin-right: auto; }
.cc-status.err { color: #8a2b2b; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-row { display: grid; grid-template-columns: 72px 14px 1fr; gap: 8px; padding: 8px 0; }
.tl-when { font-size: 11px; color: var(--muted); padding-top: 2px; }
.tl-dot-col { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent, #3d9cf0); margin-top: 4px;
}
.tl-dot.sms { background: #2f9e6b; }
.tl-dot.call { background: #c48a12; }
.tl-dot.email { background: #7b5ea7; }
.tl-line { flex: 1; width: 2px; background: var(--line); margin-top: 4px; }
.tl-body {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  background: var(--bg-elev); font-size: 13px;
}
.tl-body .ch {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px;
}
.tl-meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.call-audio-error { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tl-preview { white-space: pre-wrap; word-break: break-word; }
.tl-preview.clamp {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; max-height: 6.2em;
}
.tl-row:has(.tl-dot.call) .tl-preview.clamp {
  -webkit-line-clamp: 2;
  max-height: 3.2em;
}
.tl-row:has([data-tx]:not([hidden])) .tl-preview {
  display: none;
}
.tl-toggle {
  margin-top: 6px; border: 0; background: transparent; color: var(--accent, #2b6cb0);
  font: inherit; font-size: 12px; cursor: pointer; padding: 0;
}
.tx-box {
  margin-top: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(360px, 55vh);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  touch-action: pan-y;
  overscroll-behavior: contain;
  user-select: text;
  -webkit-user-select: text;
}
.tx-box[hidden] { display: none !important; }
.tx-msg {
  width: fit-content;
  max-width: 78%;
  border: 0;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  box-sizing: border-box;
}
.tx-msg.agent {
  align-self: flex-end;
  margin-right: 8px;
  margin-left: 12%;
  background: var(--bg-elev);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.tx-msg.prospect {
  align-self: flex-start;
  margin-left: 8px;
  margin-right: 12%;
  background: var(--bg-3);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.tx-msg.system {
  align-self: center;
  max-width: 94%;
  background: transparent;
  opacity: .75;
  font-style: italic;
  font-size: 12px;
  text-align: center;
}
.tx-msg.agent + .tx-msg.agent,
.tx-msg.prospect + .tx-msg.prospect {
  margin-top: -2px;
}
.tx-msg.agent + .tx-msg.agent {
  border-top-right-radius: 6px;
}
.tx-msg.prospect + .tx-msg.prospect {
  border-top-left-radius: 6px;
}
.tx-msg.agent + .tx-msg.agent .tx-role,
.tx-msg.prospect + .tx-msg.prospect .tx-role {
  display: none;
}
.tx-msg.agent + .tx-msg.agent .tx-head:not(:has(.tx-at)),
.tx-msg.prospect + .tx-msg.prospect .tx-head:not(:has(.tx-at)) {
  display: none;
}
.tx-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.tx-role {
  display: block;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0;
}
.tx-at {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.tx-text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tx-empty { color: var(--muted); font-size: 12px; padding: 6px; }
.geo-map-toolbar { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.widget[data-kind="map"] .geo-map-card > .card-h { display: none; }
.widget[data-kind="map"] .wh { flex-wrap: wrap; }
.wh [data-widget-sub] {
  order: 3;
  flex: 1 0 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.geo-pin-card .badge {
  display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 999px;
  margin-right: 4px; background: var(--chip, #eef1f5); color: var(--muted);
  border: 1px solid var(--line);
}
.geo-map-legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--muted); }
.geo-leg {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0; padding: 2px 6px; border: 0; border-radius: 999px;
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.geo-leg.on { background: var(--fill-2, #dcdfe4); color: var(--text, #222); }
.geo-leg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.geo-leg-n { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text); }
.geo-leg-pct { font-variant-numeric: tabular-nums; color: var(--muted); }
.geo-map-insights {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.geo-insights-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}
.geo-insights-toggle::before {
  content: "▾";
  font-size: 10px;
}
.geo-map-insights.collapsed .geo-insights-toggle::before { content: "▸"; }
.geo-map-insights.collapsed .geo-insights-body { display: none; }
.geo-stats {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 3px 12px;
  margin: 6px 0 0;
  font-size: 12px;
}
.geo-stats dt { color: var(--muted); }
.geo-stats dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.geo-stats dd.pct { color: var(--muted); font-weight: 500; min-width: 2.5em; }
.geo-notes {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  color: var(--text);
}
.geo-map-canvas { height: 280px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); touch-action: none; }
.geo-map-canvas .leaflet-container { height: 100%; width: 100%; border-radius: 10px; touch-action: none; }
.geo-pin-card { min-width: 150px; max-width: 240px; }
.geo-pin-card .meta { font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.geo-pin-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.leaflet-popup.geo-pin-pop .leaflet-popup-content-wrapper {
  background: var(--bg-elev, #fff); color: inherit; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 20px rgba(20, 28, 40, .12);
}
.leaflet-popup.geo-pin-pop .leaflet-popup-content { margin: 10px 12px; }
.leaflet-popup.geo-pin-pop .leaflet-popup-tip { background: var(--bg-elev, #fff); }
.widget[data-kind="map"] {
  isolation: isolate;
  transform: translateZ(0);
}
.widget[data-kind="map"] .leaflet-container {
  z-index: 0;
  isolation: isolate;
}
.widget[data-kind="map"] .wb {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: none;
  padding: 8px 10px 10px;
}
.widget[data-kind="map"] .lab-live,
.widget[data-kind="map"] [data-map-root] {
  flex: 1;
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.widget[data-kind="map"] .geo-map-card {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: none;
  background: transparent;
  box-shadow: none;
}
.widget[data-kind="map"] .geo-map-card .card-b {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.widget[data-kind="map"] .geo-map-toolbar { flex: 0 0 auto; margin-bottom: 8px; }
.widget[data-kind="map"] .geo-map-insights { flex: 0 0 auto; }
.widget[data-kind="map"] .geo-map-canvas {
  flex: 1;
  min-height: 0;
  height: auto;
  width: 100%;
}
.geo-ring-label { background: transparent; border: none; pointer-events: none; }
.geo-ring-label span {
  font-size: 10px; color: var(--muted); background: rgba(255,255,255,.88);
  padding: 1px 6px; border-radius: 8px; white-space: nowrap;
}
.park-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.park {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg-elev);
}
.park h4 { margin: 0 0 4px; font-size: 13px; }
.park .meta { font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }
.widget[data-kind="sms"] .wb {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sms-msgs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
}
.sms-compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 8px;
  flex: 0 0 auto;
}
.sms-compose textarea {
  flex: 1;
  min-height: 44px;
  resize: vertical;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}
.card[data-kind="sms"] .card-b {
  max-height: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stream-loader-wrap { display: flex; align-items: center; gap: 8px; padding: 4px 0 8px; color: var(--muted); font-size: 12px; }
.stream-loader-wrap.hidden { display: none; }
.md-prose p { margin: 0 0 8px; }
.md-prose p:last-child { margin-bottom: 0; }
.bubble {
  max-width: 88%; padding: 8px 10px; border-radius: 12px; font-size: 0.92em; line-height: 1.35;
  border: 1px solid var(--line);
}
.in { align-self: flex-start; background: var(--bg-3); }
.out { align-self: flex-end; background: #e6e6e6; }
.tl { font-size: 0.92em; color: var(--muted); display: grid; grid-template-columns: 64px 1fr; gap: 8px; margin: 6px 0; }
.messages {
  flex: 1; min-height: 0; overflow: auto;
  padding: 16px 16px calc(16px + var(--vv-bottom, 0px));
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.msg { max-width: min(720px, 100%); animation: rise .2s ease; }
.msg.user { align-self: flex-end; }
.who { font-size: 11px; color: var(--muted); margin: 0 0 4px 8px; }
.msg.user .who { text-align: right; margin-right: 8px; }
.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.card-h {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--bg-3); border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 650;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.card-h.is-held {
  cursor: grabbing;
  filter: brightness(0.96);
}
.card-h span { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 11px; }
.card-h b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-b { padding: 10px 12px; }
.messages .card-b {
  max-height: 280px;
  overflow: auto;
  touch-action: pan-x pan-y;
}
.prose { line-height: 1.5; font-size: 14px; color: var(--text); }
.composer {
  border-top: 1px solid var(--line); padding: 10px 12px;
  display: flex; gap: 8px;
  background: var(--bg);
  position: relative;
  z-index: 6;
  transform: translateY(calc(-1 * var(--vv-bottom, 0px)));
}
.composer textarea {
  flex: 1; min-height: 44px; resize: vertical;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px;
}
.send {
  background: linear-gradient(135deg, #4a4a4a, #111);
  color: #fff; font-weight: 800; border: 0; min-width: 72px;
}
.hint { font-size: 11px; color: var(--faint); padding: 0 4px 8px; }
.settings {
  position: absolute;
  left: 10px;
  top: 52px;
  z-index: 2000;
  width: min(248px, calc(100% - 20px));
  max-height: calc(100% - 62px);
  overflow: auto;
}
.settings[hidden] { display: none !important; }
.settings-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
}
.settings-card header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.settings-card header strong { font-size: 13px; }
.settings-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--muted); margin: 10px 0;
}
.step {
  display: flex; align-items: center; gap: 8px;
}
.step input {
  flex: 1; text-align: center; min-width: 0;
}
.step input[type="range"] {
  text-align: left;
  accent-color: #2a2d33;
  height: 22px;
}
.step .val {
  flex: 0 0 auto;
  width: 3.2em;
  min-width: 3.2em;
  padding: 4px 2px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: center;
}
.settings-card .hint { padding: 8px 0 0; margin: 0; }
.settings-card .danger {
  width: 100%;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 650;
}
.settings-card .danger:disabled {
  opacity: 0.55;
  cursor: default;
}
.fab {
  display: none;
  position: fixed;
  left: calc(16px + var(--vv-left, 0px));
  bottom: calc(18px + var(--vv-bottom, 0px));
  z-index: 40;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #2a2a2a;
  background: linear-gradient(145deg, #fafafa, #e3e3e3);
  box-shadow:
    8px 10px 18px rgba(0, 0, 0, .16),
    -6px -6px 14px rgba(255, 255, 255, .95),
    inset 1px 1px 2px rgba(255, 255, 255, .85),
    inset -1px -1px 2px rgba(0, 0, 0, .06);
}
.fab:hover { background: linear-gradient(145deg, #ffffff, #e8e8e8); }
.fab:active,
body.surface-board .fab {
  background: linear-gradient(145deg, #dcdcdc, #efefef);
  box-shadow:
    inset 7px 9px 16px rgba(0, 0, 0, .18),
    inset -6px -7px 14px rgba(255, 255, 255, .88),
    2px 3px 6px rgba(0, 0, 0, .06);
}
.fab svg-icon {
  width: 22px;
  height: 22px;
  display: none;
  pointer-events: none;
}
.fab .ico-board { display: inline-flex; }
.fab .ico-chat { display: none; }
body.surface-board .fab .ico-board { display: none; }
body.surface-board .fab .ico-chat { display: inline-flex; }
.board.settings-open #boardSettingsBtn,
.chat.settings-open #chatSettingsBtn {
  background: var(--fill-2);
}
#chatSettings {
  max-height: calc(100% - 62px);
  overflow: auto;
  width: min(320px, calc(100% - 20px));
}
.chat-threads {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(32vh, 240px);
  overflow: auto;
  margin: 8px 0 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 12px;
}
.chat-thread-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  position: relative;
  overflow: visible;
}
.chat-thread {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
  min-width: 0;
  width: auto;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-2);
}
.chat-thread-row .menu {
  flex: 0 0 32px;
  align-self: center;
}
.chat-thread-row .menu .icon-btn {
  width: 32px;
  height: 32px;
}
#chatSettings .menu .pop {
  z-index: 4000;
  min-width: 132px;
}
#chatSettings .menu .pop [data-session-act="delete"] {
  color: #8a2b2b;
}
.chat-thread strong {
  font-size: 12px;
  font-weight: 650;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-thread .muted {
  font-size: 11px;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-thread.on {
  background: var(--bg-elev);
  border-color: #888;
  box-shadow: var(--shadow-sm);
}
#chatSettings #newChatBtn {
  width: 100%;
  margin-top: 4px;
}
.empty {
  color: var(--muted); font-size: 13px; padding: 24px 8px; text-align: center;
}
.drag-shield {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  touch-action: none;
  cursor: grabbing;
}
.place-ghost {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  transform: translate(-50%, -70%);
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
body.is-placing {
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
body.is-placing .card-h { touch-action: none; }
body.is-placing .drag-shield { display: block; }
@media (max-width: 860px) {
  .shell, .shell.chat-left { flex-direction: column; }
  .board, .chat { flex: 1 1 auto; min-width: 0; width: 100%; }
  .split, .split-gutter, .split-collapse { display: none; }
  .board { border-right: 0; border-bottom: 1px solid var(--line); }
  body.surface-chat .board { display: none; }
  body.surface-board .chat { display: none; }
  /* Firefox Android fires pointercancel if the pointerdown target is
     display:none. Keep chat in the tree while placing from chat. */
  body.is-placing.origin-chat .shell { position: relative; }
  body.is-placing.origin-chat .board {
    display: flex !important;
    position: relative;
    z-index: 1;
  }
  body.is-placing.origin-chat .chat {
    display: flex !important;
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
  }
  .fab {
    display: grid;
    place-items: center;
    grid-row: 2;
    grid-column: 1;
  }
  body.surface-chat .composer { padding-left: 72px; }
  .who { overflow-x: auto; }
  .who-email-wrap { display: none; }
}

luboo-dialog { display: none; }
dialog.luboo-dialog,
dialog.workspace-dialog {
  position: fixed;
  margin: auto;
  width: min(420px, 90vw);
  max-width: 90%;
  padding: 22px 22px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  box-shadow: var(--shadow);
  overflow: visible;
}
dialog.workspace-dialog::backdrop {
  background: rgba(20, 20, 20, 0.28);
  backdrop-filter: blur(3px);
}
dialog.workspace-dialog[open] { animation: rise .16s ease; }
dialog.workspace-dialog h2 {
  margin: 0 36px 14px 0;
  font-size: 18px; font-weight: 650;
}
dialog.luboo-dialog .luboo-dialog-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 8px;
  background: var(--fill); color: var(--text);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
dialog.luboo-dialog .luboo-dialog-body {
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
dialog.luboo-dialog .luboo-dialog-body > :first-child { margin-top: 0; }
dialog.luboo-dialog .luboo-dialog-body > :last-child { margin-bottom: 0; }
dialog.workspace-dialog > form[method="dialog"] {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
dialog.workspace-dialog .dialog-buttons-secondary:empty { display: none; }
dialog.workspace-dialog .dialog-buttons {
  display: flex; justify-content: flex-end; gap: 8px; margin-left: auto;
}
dialog.workspace-dialog .dialog-button {
  padding: 6px 14px; border-radius: 9px; font: inherit; font-size: 13px;
}
dialog.workspace-dialog .dialog-danger {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 650;
}
dialog.workspace-dialog .dialog-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
}
dialog.workspace-dialog .dialog-input:focus {
  outline: 2px solid #3d9cf0;
  outline-offset: 0;
}
dialog.desk-menu-dialog .luboo-dialog-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
dialog.desk-menu-dialog .signout {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px auto 4px;
  font-weight: 650;
  font-size: 13px;
}
.id-card {
  margin: 0; display: grid; gap: 8px; width: 100%;
}
.id-card > div {
  display: grid; grid-template-columns: 64px 1fr; gap: 8px;
  align-items: baseline; font-size: 13px;
}
.id-card dt { margin: 0; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.id-card dd { margin: 0; font-weight: 550; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Daygrid heatmap (#702): 11px GitHub-style cells, spectrum or bands. */
.widget[data-kind="daygrid"] .wb {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.lab-live[data-daygrid-root] {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.dg .chip { padding: 2px 8px; }
.chip-row.dg-tabs { margin-bottom: 0; }
.dg {
  --dg-cell: 14px;
  --dg-gap: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  height: 100%;
  font-size: 11px;
  color: var(--muted);
}
.dg-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  flex: 0 0 auto;
}
.dg-tabs { margin-bottom: 0; }
.dg-tools {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.dg.dg-show-tools .dg-tools { display: flex; }
.dg-menu { margin-left: auto; }
.dg-tools label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.dg-tools select { font-size: 11px; padding: 2px 4px; }
.dg-months {
  display: grid;
  grid-auto-rows: 36px;
  column-gap: var(--dg-gap);
  overflow: visible;
  height: 36px;
  min-height: 36px;
  flex: 0 0 auto;
}
.dg-month {
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
  height: 36px;
  width: var(--dg-cell);
  display: flex;
  align-items: flex-end;
  color: var(--muted);
  pointer-events: none;
}
.dg-body { display: flex; gap: 8px; min-width: 0; flex: 1 1 auto; min-height: 95px; }
.dg-scroll {
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  touch-action: pan-x;
  overscroll-behavior: contain;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.dg-scroll::-webkit-scrollbar { height: 6px; }
.dg-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 3px;
}
.dg-dows-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: 28px;
}
.dg-dows-spacer { height: 36px; flex: 0 0 auto; }
.dg-dows {
  display: grid;
  grid-template-rows: repeat(7, var(--dg-cell));
  gap: var(--dg-gap);
  width: 28px;
  font-size: 9px;
  line-height: var(--dg-cell);
  color: var(--muted);
}
.dg-dows span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 2px;
}
.dg-grid {
  display: grid;
  grid-template-rows: repeat(7, var(--dg-cell));
  gap: var(--dg-gap);
  touch-action: pan-x;
}
.dg-cell {
  width: var(--dg-cell);
  height: var(--dg-cell);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 3px;
  background: var(--fill, #e8e8e8);
  min-width: 0;
  display: block;
  touch-action: pan-x;
}
.dg-cell.dg-pad { background: transparent; pointer-events: none; box-shadow: none; }
button.dg-cell:hover { outline: none; background: inherit; }
.dg-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  flex: 0 0 auto;
}
.dg-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}
.dg-ramp {
  display: inline-block;
  width: 72px;
  height: 8px;
  border-radius: 4px;
}
.dg-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
}
.dg-summary { font-size: 11px; color: var(--muted); }
.dg-day-pop,
.dg-tools-pop {
  position: fixed;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: min(60vh, 420px);
  overflow: auto;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
}
.dg-day-pop[hidden],
.dg-tools-pop[hidden] { display: none; }
.dg-day-pop-h {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  padding: 2px 4px 4px;
}
.dg-day-row {
  padding: 4px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dg-day-main {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.dg-day-main:hover { background: var(--fill); }
.dg-day-meta { font-weight: 600; }
.dg-day-body { margin-top: 4px; color: var(--text); }
.dg-day-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 6px 6px;
}
.dg-tools-pop label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
}
.card[data-kind="daygrid"] .card-b {
  height: 280px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.card[data-kind="daygrid"] .lab-live[data-daygrid-root] { height: 100%; }

.widget[data-kind="site"] .wb {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
}
.lab-live[data-site-root] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.site-frame-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  gap: 6px;
}
.site-frame-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
}
.site-url-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.site-url-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 4px 8px;
}
.site-frame {
  flex: 1;
  min-height: 160px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  touch-action: auto;
}
.site-frame-hint { font-size: 11px; color: var(--faint); margin: 0; }
.card[data-kind="site"] .card-b {
  height: 320px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.card[data-kind="site"] .lab-live[data-site-root] {
  height: 100%;
}
