:root {
  color-scheme: light;
  --paper: #fff;
  --white: #fff;
  --ink: #222b27;
  --muted: #56645b;
  --green: #255844;
  --deep: #194632;
  --sage: #eaf1ea;
  --line: #e2e8e2;
  --pending: #785315;
  --pending-bg: #f6eedb;
  --gutter: clamp(17px, 5.4vw, 24px);
  --radius: 16px;
  --nav-bottom: max(10px, env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); touch-action: pan-x pan-y; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.4; }
button, input, textarea, select { font: inherit; }
button { min-inline-size: 44px; min-block-size: 44px; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font-size: max(16px, 1rem); }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:is(button, a, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
:is(.chips button, #navigation button, .message-row button, .latest-message):focus-visible {
  outline-offset: -2px;
}
:is(input, textarea, select):focus { border-color: #a3bcae; }
.sheet-head h2:focus { outline: none; }
button:disabled { cursor: default; opacity: .5; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.5rem, 6vw, 1.9rem); line-height: 1.12; letter-spacing: -.042em; font-weight: 680; }
h2 { font-size: 1rem; font-weight: 680; }
small { font-size: .875rem; }
svg { display: block; width: 20px; height: 20px; flex: none; }
.shell { max-width: 540px; margin: 0 auto; min-height: 100svh; }
#view { padding: max(12px, env(safe-area-inset-top)) var(--gutter) calc(82px + var(--nav-bottom)); }
.header { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.brand { color: var(--green); font-size: clamp(1.05rem, 5.05vw, 1.55rem); font-weight: 670; letter-spacing: -.045em; margin-bottom: 7px; }
.preview-label, .subtitle { color: var(--muted); font-size: .875rem; margin-top: 3px; }
.icon, .back { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 13px; }
.icon { background: var(--sage); color: var(--green); }
.back { margin-left: -10px; color: var(--green); }
.route-back {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  max-inline-size: min(10rem, 44vw);
  padding-inline: 4px 8px;
  text-align: start;
}
.route-back span { overflow-wrap: anywhere; }
.back-row:has(> .route-back) > div { min-inline-size: 0; }
.back-row { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.back-row .subtitle { margin-top: 2px; }
.chips { display: flex; align-items: center; gap: 7px; }
.chip { white-space: nowrap; min-height: 44px; padding: 0 12px; border-radius: var(--radius); background: #f0f3ee; flex: none; font-size: .875rem; }
.chip[aria-pressed=true] { background: var(--green); color: var(--white); font-weight: 650; }
.strip { display: flex; gap: 3px; align-items: center; margin-bottom: 13px; }
.strip .chips { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; scroll-snap-type: x proximity; }
.strip .chips::-webkit-scrollbar { display: none; }
.strip .chip { scroll-snap-align: start; }
.strip-next { width: 44px; min-height: 44px; flex: none; padding: 0; display: grid; place-items: center; color: var(--green); }
.search { width: 100%; min-height: 44px; padding: 9px 13px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); color: var(--ink); }
.list { display: grid; border-top: 1px solid var(--line); }
.row { display: grid; align-items: center; grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 12px; width: 100%; text-align: left; min-height: 76px; border-bottom: 1px solid var(--line); padding: 13px 0; }
.row svg { width: 16px; height: 16px; color: var(--green); }
.row-content { display: grid; gap: 2px; min-width: 0; }
.row-name { font-size: 1.07rem; font-weight: 670; letter-spacing: -.018em; }
.row-detail { color: var(--muted); overflow-wrap: anywhere; }
.row-action { color: var(--pending); font-size: .875rem; font-weight: 600; }
.avatar { align-self: center; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--sage); color: var(--deep); font-weight: 650; }
.empty { padding: 22px 0; color: var(--muted); }
.group { display: grid; gap: 9px; margin-bottom: 20px; }
.group > h2 { color: var(--green); padding: 0 1px; }
.card { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 13px; }
.card .row { border: 0; padding: 0; min-height: 50px; }
.primary, .secondary { min-height: 44px; padding: 9px 13px; border-radius: 13px; font-size: .9375rem; font-weight: 650; overflow-wrap: anywhere; }
.primary { background: var(--green); color: var(--white); }
.secondary { background: var(--sage); color: var(--deep); }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.actions > button { flex: 1 1 auto; }
.muted { color: var(--muted); }
.pending { color: var(--pending); }
.property-link { display: flex; width: 100%; align-items: center; text-align: left; gap: 11px; margin-bottom: 12px; }
.property-link > div { flex: 1; }
.thumbnail { height: 45px; width: 56px; object-fit: cover; border-radius: 9px; flex: none; }
.hero { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); margin-bottom: 13px; }
.photo-note { margin: -7px 0 13px; color: var(--muted); font-size: .8125rem; }
.feed { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.bubble { align-self: start; max-inline-size: 88%; padding: 9px 13px; border-radius: 15px; background: #efeee7; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.me { align-self: end; background: var(--green); color: var(--white); }
.bubble.private { align-self: center; background: var(--pending-bg); border: 1px solid #e7d6ac; }
.bubble.private strong { display: block; color: var(--pending); }
.feed .card { width: 100%; }
.feed .row { grid-template-columns: 34px minmax(0, 1fr) 18px; gap: 8px; }
.feed .avatar { width: 32px; height: 32px; }
.composer { position: sticky; bottom: calc(61px + var(--nav-bottom)); z-index: 2; display: grid; gap: 6px; margin-top: 13px; padding: 7px 0; background: var(--paper); }
.compose-line { display: flex; align-items: end; gap: 7px; }
.compose-line textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 124px; resize: vertical; padding: 10px 11px; border: 1px solid var(--line); background: var(--white); border-radius: 13px; color: var(--ink); }
.compose-line button { width: 44px; padding: 0; display: grid; place-items: center; flex: none; }
.mode-button { justify-self: start; color: var(--green); min-height: 44px; font-size: .875rem; padding: 0 8px; }
.mode-button[aria-pressed=true] { background: var(--pending-bg); color: var(--pending); border-radius: 10px; }
#navigation { position: fixed; z-index: 4; left: 50%; bottom: var(--nav-bottom); transform: translateX(-50%); width: min(424px, calc(100% - 20px)); display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0; padding: 4px; border: 1px solid #dfe6df; border-radius: 20px; background: var(--white); box-shadow: none; }
#navigation button { min-height: 44px; display: grid; place-content: center; place-items: center; gap: 2px; border-radius: 15px; font-size: .75rem; line-height: 1.15; color: var(--muted); padding: 0 1px; }
#navigation svg { width: 17px; height: 17px; }
#navigation button[aria-current=page] { color: var(--deep); font-weight: 700; }
dialog { width: min(470px, calc(100% - 2 * var(--gutter))); max-height: min(80dvh, 650px); overscroll-behavior: contain; scroll-padding-block: 12px; border: 1px solid var(--line); border-radius: 20px; padding: 17px; background: var(--paper); color: var(--ink); }
html:has(#sheet[open]), body:has(#sheet[open]) {
  overflow: hidden;
  overscroll-behavior: none;
}
#sheet::backdrop {
  background: rgb(26 48 39 / 22%);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
dialog[open] { box-shadow: 0 12px 36px #152b2424; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.sheet-head h2 { font-size: 1.125rem; letter-spacing: -.025em; }
.sheet-form { display: grid; gap: 11px; }
.sheet-form label { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 4px; }
.sheet-form :is(input, select) { min-height: 44px; width: 100%; min-width: 0; max-width: 100%; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); color: var(--ink); }
#persistence-warning {
  position: static;
  margin: 8px var(--gutter) 0;
  flex: none;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e7d6ac;
  border-radius: 10px;
  background: var(--pending-bg);
  color: var(--pending);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.chat-mode #persistence-warning {
  margin: 4px var(--chat-gutter) 2px;
  max-height: max(44px, min(96px, calc(var(--chat-height, 100dvh) * .25)));
  overflow: auto;
  overscroll-behavior: contain;
}
#status:empty { display: none; }
#status { z-index: 5; position: fixed; bottom: calc(61px + var(--nav-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2 * var(--gutter)); padding: 8px 12px; background: var(--deep); color: var(--white); border-radius: 11px; font-size: .875rem; }
#navigation[hidden] { display: none; }
.chat-mode { overflow: hidden; }
.chat-mode .shell { min-height: 0; }
body.chat-mode #view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  padding-bottom: max(5px, env(safe-area-inset-bottom));
  overflow: hidden;
  overflow: clip;
}
body.chat-mode.keyboard-visible #view { padding-bottom: 5px; }
.chat-mode #status { position: static; transform: none; align-self: center; flex: none; margin: 3px 0; max-width: calc(100% - 2 * var(--chat-gutter)); pointer-events: none; overflow-wrap: anywhere; }
.chat-mode .header { align-items: center; flex: none; margin-bottom: 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.chat-mode .back-row { margin-bottom: 0; min-width: 0; }
.chat-mode .back-row h1, .chat-mode .back-row .subtitle { overflow-wrap: anywhere; }
.conversation-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 0 2px 12px;
  margin: 0 -2px;
}
.chat-mode .composer { position: static; margin: 0; flex: none; border-top: 1px solid var(--line); gap: 1px; }
.chat-mode .compose-line textarea { resize: none; }

.assistant-attention {
  display: grid;
  gap: 4px;
  max-block-size: min(10rem, 24dvh);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-block: 5px;
}
.assistant-attention .actions > button { flex: 0 1 auto; }
.chat-mode.keyboard-visible :is(.assistant-attention, .assistant-prompts) { display: none; }
.assistant-prompts { display: flex; flex-wrap: wrap; gap: 4px 6px; flex: none; padding: 4px 1px 6px; }
.assistant-prompts .chip { background: var(--sage); color: var(--deep); white-space: normal; overflow-wrap: anywhere; }

.chat-work { margin: 8px 0 0; }
.chat-work summary { cursor: pointer; color: var(--green); font-size: .875rem; padding: 8px 2px; min-height: 44px; }
.chat-work[open] > :not(summary) { margin-bottom: 8px; }
.listing-answer + .listing-answer { border-top: 1px solid var(--line); padding-top: 7px; }
.work-card { border-color: #d6e3d8; }
.work-label { color: var(--green); font-size: .875rem; font-weight: 650; }
.work-card .actions { margin-top: 3px; }
.activity { font-size: .875rem; color: var(--muted); }
.activity summary { min-height: 44px; display: list-item; padding: 11px 5px; cursor: pointer; }
.activity ul { margin: 0 0 6px; padding-inline-start: 25px; }
.activity li + li { margin-top: 7px; }
.lead-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 1px; }
.tag { border-radius: 9px; padding: 2px 7px; font-size: .8125rem; color: var(--muted); background: #eeefe9; }
.ai-tag { color: var(--deep); background: var(--sage); }
.human-tag { color: var(--pending); background: var(--pending-bg); }
.schedule-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.sheet-form textarea { width: 100%; min-width: 0; min-height: 70px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.sheet-form [hidden] { display: none; }
.followup-context { margin: 0; border-left: 3px solid #cbdace; padding: 4px 8px 4px 10px; color: var(--muted); }
.mode-help { font-size: .875rem; }

.inbox-filters { overflow-x: auto; scrollbar-width: none; }
.inbox-filters::-webkit-scrollbar { display: none; }
.unread-count { display: grid; place-items: center; min-width: 18px; min-height: 18px; padding: 1px 3px; border-radius: 12px; color: var(--white); background: var(--green); font-size: .6875rem; }
.thread-header-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 5px; max-width: 52%; }
.thread-header-actions .secondary { font-size: .8125rem; padding-inline: 7px; }
.thread-search { display: flex; flex: none; align-items: center; gap: 4px; padding: 7px 0 2px; }
.thread-search[hidden], .quote-preview[hidden] { display: none; }
.thread-search .search { min-width: 64px; margin: 0; }
.thread-search .subtitle { white-space: nowrap; margin: 0; }
.thread-search .back { margin: 0; }
.message-row { display: flex; align-items: center; width: 100%; min-width: 0; gap: 4px; }
.message-row.outgoing { flex-direction: row-reverse; }
.message-row .bubble { width: fit-content; max-width: min(86%, calc(100% - 48px)); min-width: 0; }
.message-text { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; row-gap: 2px; }
.message-text p { min-width: 0; max-width: 100%; }
.message-time { margin-inline-start: auto; display: block; font-size: .68rem; white-space: nowrap; color: var(--muted); }
.me .message-time { color: #edf5ed; }
.chat-date { align-self: center; padding: 3px 10px; border-radius: 20px; color: var(--muted); background: var(--white); font-size: .76rem; }
.reply-icon { display: grid; place-items: center; flex: none; color: var(--green); }
.reply-icon svg { width: 17px; }
.message-selected > .bubble, .bubble.message-selected { outline: 2px solid var(--green); outline-offset: 2px; }
.quote-preview { display: flex; align-items: center; justify-content: space-between; border-left: 3px solid var(--green); background: var(--sage); padding: 3px 4px 3px 9px; border-radius: 8px; margin-bottom: 5px; min-width: 0; font-size: .8125rem; }
.quote-preview div { min-width: 0; }
.quote-preview p, .quoted-message { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-preview .back { margin: 0; align-self: stretch; }
.quoted-message { display: block; width: 100%; padding: 4px 6px; text-align: left; color: inherit; background: #ffffff29; border-left: 2px solid currentColor; border-radius: 5px; font-size: .8125rem; margin-bottom: 3px; }
html.chat-active, body.chat-mode { height: 100%; overflow: hidden; overscroll-behavior: none; }
/* Header and composer share one viewport origin, height and painting layer. */
#chat-chrome {
  flex: none;
  min-width: 0;
  max-height: min(48%, 340px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: max(12px, env(safe-area-inset-top)) var(--chat-gutter) 0;
  background: var(--paper);
}
.chat-mode .shell {
  position: fixed;
  top: var(--chat-top, 0px);
  inset-inline: 0;
  width: 100%;
  height: 100vh;
  height: var(--chat-height, 100dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow: clip;
  background: var(--paper);
}
.chat-mode.keyboard-visible #chat-chrome .chat-work[open] {
  max-height: min(135px, calc(var(--chat-height, 100dvh) * .35));
}
.history-layout {
  position: relative;
  overflow: hidden;
  overflow: clip;
  display: flex;
  flex: 1;
  min-height: 0;
}
.history-controls {
  position: absolute;
  inset-inline-end: 4px;
  bottom: 6px;
  pointer-events: none;
}
.latest-message { width: 44px; height: 44px; padding: 0; pointer-events: auto; border: 1px solid var(--line); border-radius: 50%; }
.history-layout:has(.latest-message:not([hidden])) .conversation-body { scroll-padding-bottom: 54px; }
.latest-message[hidden], .compose-line [hidden] { display: none; }
.history-layout .conversation-body {
  margin: 0;
  padding-inline: 0 3px;
  scrollbar-width: thin;
}
.history-layout .conversation-body { display: flex; flex-direction: column; }
.history-layout .feed { flex-shrink: 0; margin-top: auto; padding-top: 14px; }
.history-layout .chat-work { flex-shrink: 0; }
.chat-mode .bubble-media, .attachment-preview { display: block; width: 100%; max-height: 230px; object-fit: contain; border-radius: 8px; }
.bubble-audio { display: block; width: min(230px, 100%); }
.message-author { display: block; font-size: .8125rem; margin-bottom: 2px; }
.message-row .reply-icon { padding: 0; }

body.chat-mode { --chat-gutter: clamp(10px, 3vw, 18px); }
body.chat-mode #view { --gutter: var(--chat-gutter); }
.chat-mode .header { padding-bottom: 5px; }
.chat-mode .composer {
  margin-inline: calc(-1 * var(--gutter));
  padding: 5px var(--gutter) 9px;
}
.reveal-without-pan { transform: translateY(-2000px); }
.chat-mode .chat-work { margin-block: 0; flex: none; max-height: min(35dvh, 250px); overflow: auto; overscroll-behavior: contain; }

.chat-mode .compose-line { gap: 4px; }
.chat-mode .compose-line textarea {
  line-height: 1.35;
  max-height: max(44px, min(112px, calc(var(--chat-height, 100dvh) * .30)));
  field-sizing: content;
}
.chat-mode .compose-line textarea:focus { outline-offset: 0; }
.chat-mode .compose-line .plain-icon { color: var(--green); }
.composer-shortcuts { display: flex; flex-shrink: 0; }

.composer .note-mode:not([hidden]) { display: flex; align-items: center; justify-content: space-between; background: var(--pending-bg); color: var(--pending); padding-inline: 10px; border-radius: 10px; font-size: .82rem; }
.composer .note-mode .back { margin: 0; }
.writing-note .compose-line textarea { border-color: #bd9b62; }
.composer.recording .compose-line { display: none; }
.recording-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; min-height: 48px; }
.recording-cancel, .recording-stop { display: grid; place-items: center; min-height: 44px; padding: 0; }
.recording-cancel { color: var(--muted); }
.recording-stop { border-radius: 50%; background: #a72e34; }
.recording-signal { display: flex; align-items: center; min-width: 0; gap: 10px; }
.recording-pulse { position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: #f9e7e7; color: #a72e34; }
.recording-pulse::after { content: ''; position: absolute; inset: -3px; border: 1px solid #a72e34; border-radius: inherit; animation: recording-pulse 1.5s ease-out infinite; }
.recording-pulse svg { width: 17px; height: 17px; }
.recording-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 9px; font-size: .825rem; color: var(--muted); }
.recording-time { color: var(--ink); font-size: .95rem; font-weight: 650; font-variant-numeric: tabular-nums; }
@keyframes recording-pulse { from { opacity: .65; transform: scale(.8); } to { opacity: 0; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .recording-pulse::after { animation: none; opacity: .5; } }
.attachment-tray { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: none; gap: 4px; padding: 7px 0 5px; }
.attachment-tile { display: grid; justify-items: center; align-content: center; min-height: 54px; gap: 3px; padding: 5px 2px; color: var(--deep); border-radius: 10px; font-size: .77rem; }
.attachment-tile:active { background: var(--sage); }
.message-file { display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 100%; padding: 7px 9px; border-radius: 9px; background: #ffffff21; color: inherit; text-decoration: none; white-space: normal; }
.message-file span { min-width: 0; }
.message-file small { display: block; font-size: .73rem; }
.file-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; }
dialog { position: fixed; overflow: auto; overflow-x: hidden; }
dialog[data-placement=schedule] {
  inset: max(24px, calc(env(safe-area-inset-top) + 12px)) 0 auto;
  margin: 0 auto;
}
dialog[data-placement=bottom] {
  inset: auto 0 max(16px, env(safe-area-inset-bottom));
  margin: 0 auto;
}
dialog.sheet-keyboard {
  --sheet-top: max(calc(var(--visible-top) + 12px), env(safe-area-inset-top));
  top: var(--sheet-top);
  bottom: auto;
  margin: 0 auto;
  max-height: max(0px, calc(var(--visible-bottom) - var(--sheet-top) - 14px));
}
dialog[data-placement=bottom].sheet-keyboard {
  top: auto;
  bottom: calc(max(0px, 100% - var(--visible-bottom)) + 14px);
}
dialog[data-placement=schedule].sheet-keyboard {
  --sheet-top: max(calc(var(--visible-top) + 12px), 24px, calc(env(safe-area-inset-top) + 12px));
}
.schedule-fields input {
  display: block;
  appearance: none;
  min-inline-size: 0;
  text-align: start;
}
.schedule-fields input::-webkit-date-and-time-value { min-inline-size: 0; text-align: start; }
.message-menu:not(:focus-visible) { opacity: .65; }
@media (max-width: 425px) {
  .schedule-fields { grid-template-columns: minmax(0, 1fr); }
}

.history-layout .conversation-body { padding-inline-end: 12px; scrollbar-gutter: stable; }

.compact-filters { gap: 6px; overflow-x: auto; scrollbar-width: none; }
.compact-filters::-webkit-scrollbar { display: none; }
.compact-filters .chip { display: inline-grid; place-items: center; position: relative; isolation: isolate; min-height: 44px; padding: 0 10px; background: transparent; color: var(--muted); font-size: .81rem; font-weight: 550; }
.compact-filters .chip::before { content: ''; position: absolute; inset: 6px 0; z-index: -1; border-radius: 20px; background: #f0f3ee; }
.compact-filters .chip[aria-pressed=true] { color: var(--deep); font-weight: 680; }
.compact-filters .chip[aria-pressed=true]::before { background: #e0ece2; }
.agenda-filters { margin-bottom: 12px; }
.agenda-actions > button { font-size: .85rem; }

.form-status { color: var(--pending); font-size: .875rem; }
.form-status:empty { display: none; }
.visit-preview-text { white-space: pre-wrap; }
.agenda-actions > button.secondary { padding-inline: 10px; background: transparent; border: 1px solid var(--line); }

.workflow-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.handoff-card, .question-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-inline-size: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  text-align: start;
  overflow-wrap: anywhere;
}
.handoff-card {
  border-inline-start: 3px solid var(--green);
}
.question-card {
  border-inline-start: 3px solid var(--pending);
}
.question-card[data-status="answered"], .question-card[data-status="resolved"] {
  border-inline-start-color: var(--line);
}
.handoff-card :is(h2, h3), .question-card :is(h2, h3) {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}
.question-meta {
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.feed > .question-card {
  align-self: start;
  inline-size: min(100%, 28rem);
}
button:is(.handoff-card, .question-card) {
  width: 100%;
}
.workflow-list :is(button, a),
:is(.handoff-card, .question-card, .visit-deliveries) :is(button, a),
button:is(.handoff-card, .question-card) {
  min-block-size: 44px;
  min-inline-size: 44px;
}
:is(.handoff-card, .question-card, .visit-deliveries) a {
  display: inline-flex;
  align-items: center;
}

#navigation button:has(.nav-badge) { position: relative; }
#navigation .nav-badge {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: calc(50% + 6px);
  display: grid;
  place-items: center;
  min-inline-size: 1.125rem;
  min-block-size: 1.125rem;
  padding-inline: .22rem;
  border: 1px solid var(--white);
  border-radius: 999px;
  background: var(--pending);
  color: var(--white);
  font-size: .675rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
#navigation .nav-badge:empty { display: none; }

.visit-deliveries {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding-inline: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}
.visit-delivery-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    padding-block: 9px;
    font-size: .875rem;
    overflow-wrap: anywhere;
  }
.visit-delivery-row + .visit-delivery-row { border-block-start: 1px solid var(--line); }
.visit-channel { color: var(--muted); font-size: .8rem; }
.visit-deliveries { padding-block: 0; margin-block: 0; list-style: none; }
.sheet-form .qualification-check {
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    min-height: 44px;
    gap: 10px;
  }
.qualification-check input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--green); }
.agenda-create { margin-block: 0 14px; }
.agent-tools, .takeover-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.agent-tools { min-height: 50px; }
.takeover-card { margin-block: 4px; }
.composer[hidden] { display: none; }
.quiet-button { border-color: transparent; background: transparent; color: var(--muted); }

.access { padding: max(12px, env(safe-area-inset-top)) var(--gutter) 28px; }
.access form { margin-top: 16px; }
.pilot-history .bubble p { white-space: pre-wrap; }
.pilot-history .message-time { white-space: normal; }
.pilot-message-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: end; gap: 3px 7px; }
.agenda-window { margin-bottom: 12px; }

.pipeline-views { margin-bottom: 12px; }
.requirement-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.requirement-card { display: grid; gap: 7px; overflow-wrap: anywhere; }
.requirement-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; justify-content: space-between; }
.requirement-heading h3, .requirement-candidate h3 { margin: 0; font-size: 1rem; }
.requirement-notes { white-space: pre-wrap; }
.sheet-form .requirement-check { display: flex; align-items: center; min-height: 44px; gap: 9px; }
.sheet-form .requirement-check input { width: 19px; min-height: 19px; accent-color: var(--green); }


.planning-tabs { margin-bottom: 12px; }
.compact-action, .work-menu-action {
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--deep);
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.25;
}
.compact-action.primary { color: var(--white); }
.agenda-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.agenda-toolbar h2 { font-size: 1.0625rem; }
.agenda-toolbar button { margin-inline-end: -4px; }
.agenda-content section h2 { font-size: .875rem; color: var(--muted); }
.agenda-actions { gap: 0 6px; }
.agenda-actions > button, .chat-work-panel .actions > button { flex: 0 1 auto; }
.agenda-actions .compact-action:not(.primary) { background: var(--paper); }
.chat-work-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  inline-size: 100%;
  text-align: start;
  padding-inline: 0;
  flex-shrink: 0;
}
.chat-work-trigger svg { width: 16px; height: 16px; }
.chat-work-panel, .chat-work-tasks, .chat-work-menu { display: grid; gap: 8px; min-inline-size: 0; }
.chat-work-bar { display: flex; align-items: center; gap: 8px; }
.chat-work-bar .chat-work-trigger { flex: 1 1 auto; min-width: 0; width: auto; }
.chat-work-bar .handover-return { flex: 0 0 auto; padding-inline: 3px; font-size: .78rem; color: var(--green); }
.chat-work-panel { gap: 15px; }
.chat-work-panel .property-link { margin: 0; background: #f6f8f6; }
.chat-work-panel h3 { margin: 0; color: var(--muted); font-size: .875rem; }
.chat-work-panel .actions :is(.primary, .secondary) { font-size: .875rem; padding: 6px 10px; }
.chat-work-menu { gap: 0; }
.chat-work-menu :is(button, .secondary) {
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: .875rem;
  padding: 6px 0;
  text-align: start;
}

.crm-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 8px 11px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.market-wordmark { color: #202d28; flex: 0 1 auto; }
.market-wordmark strong { display: block; white-space: nowrap; font-size: clamp(.84rem, 4.45vw, 1.5rem); line-height: 1.15; font-weight: 670; letter-spacing: -.038em; }
.market-wordmark strong span { display: inline; font: inherit; letter-spacing: inherit; }
.market-wordmark small { display: block; text-align: right; font-size: .65rem; line-height: 1.25; color: #66716a; }
.crm-identity { display: flex; align-items: center; gap: 4px; flex: none; }
.crm-title { font-size: clamp(1rem, 5.1vw, 1.4rem); line-height: 1; color: var(--deep); letter-spacing: -.04em; }
.crm-user { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; color: var(--deep); }
.crm-user svg { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--sage); }
@media (max-width: 350px) {
  .market-wordmark strong { font-size: .83rem; }
  .market-wordmark small { font-size: .6rem; }
  #navigation button { font-size: .7rem; }
}
.registry-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-block: 0 13px; }
.registry-location { flex: 1 1 11rem; display: grid; gap: 3px; color: var(--muted); font-size: .81rem; }
.registry-location select { width: 100%; min-width: 0; min-height: 44px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }
.lead-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 1px; }
.inbox-filters { overflow-x: auto; scrollbar-width: none; }
.inbox-filters::-webkit-scrollbar { display: none; }
.sheet-head .icon { background: transparent; border: 1px solid var(--line); border-radius: 50%; }
.sheet-head .icon svg { width: 17px; height: 17px; }
