/* Rails adaptation layer: links styled like the prototype's buttons, forms from
   button_to, Active Storage uploads, validation errors, and the sign-in screen. */

a.nav, a.btn, a.link, a.workspace, a.profile, a.thread, a.lead-card, a.stage-overview,
a.activity-row, a.notification, a.cellbtn, a.icon-btn, a.cal-event, a.task-text,
.tabs a, .search-results a, .support a {
  text-decoration: none;
  color: inherit;
}
a.link { color: #50847f; }
a.cal-event, a.lead-card, a.stage-overview, a.notification { display: block; }
a.lead-card { cursor: pointer; }
a.icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.support a { display: inline-flex; align-items: center; gap: 6px; }
.tabs a { display: inline-block; }
.cal-day.today b { color: #1caaa9; }
.thread.unread b { font-weight: 750; }
.thread.unread .body small { color: #1caaa9; font-weight: 650; }

.inline-form, .button_to { display: contents; }
button.toggle { border: 0; cursor: pointer; }
span.toggle[aria-disabled="true"] { opacity: .55; }

turbo-frame#modal { display: contents; }
turbo-frame.board-frame { display: block; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.checkbox-field { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; }
.checkbox-field input { width: auto !important; }

.form-errors { margin-bottom: 18px; border-color: #ecc8bf !important; background: #fdf3f0 !important; color: var(--red); }
.form-errors ul { margin: 8px 0 0; padding-left: 18px; }

.doc-row > span:nth-of-type(1) { display: flex; flex-direction: column; gap: 3px; }
.doc-link { color: inherit; font-weight: 600; }
.doc-meta { font-size: 13px; }
.doc-row .pill { margin-left: 0; }
.doc-row > span:nth-of-type(1), .doc-upload { flex: 1; }
.doc-upload { display: flex; justify-content: flex-end; }
.doc-upload-label { cursor: pointer; font-weight: 600; position: relative; }
.doc-upload-label:focus-within { outline: 2px solid #1caaa9; outline-offset: 3px; border-radius: 3px; }
.doc-remove { font-size: 14px; color: var(--red); }

.voicemail + .voicemail { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }

/* Sign in */
body.auth-page {
  min-height: 100vh;
  background: #e6f7f3 url("/assets/tropical-water-e7c8073f.svg") center bottom / cover no-repeat;
}
.auth-shell {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px;
}
.auth-card { width: 100%; max-width: 410px; padding: 34px 32px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 26px; }
.auth-brand .official-logo { width: 170px; height: auto; }
.auth-title { font-size: 24px; text-align: center; }
.auth-sub { text-align: center; margin: 8px 0 24px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn { margin-top: 6px; min-height: 42px; }
.auth-links { text-align: center; margin-top: 18px; }
.auth-alert { margin-bottom: 18px; color: var(--red); }
.auth-dev { margin-top: 22px; font-size: 14px; line-height: 1.7; }
.auth-footnote { margin-top: 22px; font-size: 14.5px; color: #4f7f7a; }

/* Larger type: keep short labels on one line */
.card-head h2, .card-head .date-small, .tabs a, .tabs button, .pill, .badge { white-space: nowrap; }
.tabs { overflow-x: auto; scrollbar-width: none; }
@media (max-width: 700px) {
  .tabs > span.small { display: none; }
}
.card-head { flex-wrap: wrap; row-gap: 6px; }

/* Zoom Phone setup */
.zoom-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 22px; }
.zoom-status-item { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px; border-right: 1px solid var(--line); }
.zoom-status-item:last-child { border-right: 0; }
.zoom-status-item p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #c8d9d5; margin-top: 6px; flex-shrink: 0; }
.status-dot.on { background: #1caaa9; box-shadow: 0 0 0 4px #1caaa922; }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 4px #ae625422; }
.setup-steps { display: grid; gap: 18px; }
.setup-step { padding: 24px 26px; scroll-margin-top: 20px; }
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.step-head p { color: var(--muted); margin-top: 5px; line-height: 1.55; }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: #e4f6f3; color: #187f7b; font-weight: 700; font-family: Manrope, sans-serif; }
.step-num.done { background: #1caaa9; color: #fff; }
.step-num svg { width: 16px; height: 16px; stroke-width: 2.4; }
.instructions { margin: 0; padding-left: 20px; display: grid; gap: 12px; line-height: 1.65; }
.instructions a { color: #187f7b; font-weight: 600; }
.copy-list { list-style: none; padding: 0; margin: 10px 0 4px; display: grid; gap: 8px; }
.copy-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.copy-field { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid #d8e6e4; border-radius: 6px; background: #f7fbfb; overflow: hidden; vertical-align: middle; }
.copy-field code { padding: 6px 10px; font-size: 13px; overflow-wrap: anywhere; color: #23504b; }
.copy-btn { border-left: 1px solid #d8e6e4 !important; padding: 6px 11px; font-size: 12.5px; font-weight: 600; color: #187f7b; background: #fff !important; align-self: stretch; }
.copy-btn:hover { background: #eaf7f5 !important; }
.notice.warn { margin: 10px 0; background: #fdf7ea; border-color: #ecd9ae; color: #7a5a1f; }
.notice code, .instructions code { font-size: 13px; background: #ffffff99; padding: 1px 5px; border-radius: 4px; }
.zoom-form fieldset, .setup-step fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.step-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.scope-checks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.scope-checks li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scope-checks li span { color: var(--muted); font-size: 13px; }
.scope-checks .ok svg { color: #1caaa9; stroke-width: 2.4; }
.scope-checks .missing svg, .scope-checks .missing span { color: var(--red); }
.events-table { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; }
.events-table code { font-size: 12.5px; }
.zoom-user-select { min-width: 260px; max-width: 100%; padding: 9px 10px; border: 1px solid #d8e6e4; border-radius: 6px; background: #fff; }
.setup-step .person { display: flex; gap: 10px; align-items: center; }
.setup-step .person p { font-size: 13px; color: var(--muted); }
.danger-zone .step-head { margin-bottom: 0; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 900px) {
  .zoom-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zoom-status-item:nth-child(2) { border-right: 0; }
  .zoom-status-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .setup-step { padding: 20px 16px; }
  .setup-step .setting-row { flex-wrap: wrap; gap: 12px; }
  .zoom-user-select { min-width: 0; width: 100%; }
}

/* Docked Zoom Phone dialer */
/* The dialer drops down from the phone button in the top bar; hidden (but loaded) otherwise. */
.zoom-dock { position: fixed; right: 22px; top: 70px; z-index: 55; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.zoom-dock-panel.open { pointer-events: auto; }
.zoom-dock-panel { width: 360px; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px #15372c40; overflow: hidden;
  position: absolute; right: 0; top: 0; max-height: calc(100dvh - 86px); overflow-y: auto;
  visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .15s, transform .15s; }
.zoom-dock-panel.open { visibility: visible; opacity: 1; transform: none; }
.zoom-dock-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); font-weight: 650; }
.zoom-dock-panel iframe { display: block; width: 360px; height: min(600px, calc(100dvh - 160px)); border: 0; }
.zoom-pop { background: #0a222e; color: #fff; padding: 12px 16px; display: grid; gap: 3px; }
.zoom-pop[hidden] { display: none; }
.zoom-pop span { color: #b7e3df; font-size: 13px; }
.zoom-pop a { color: #7fe0da; font-weight: 650; margin-top: 4px; }
@media (max-width: 700px) {
  .zoom-dock-panel, .zoom-dock-panel iframe { width: calc(100vw - 24px); }
  .zoom-dock-panel iframe { height: min(600px, calc(100dvh - 160px)); }
}

/* Conversations tab & recordings */
.convo-call { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.convo-call:last-child { border-bottom: 0; }
.convo-call .activity-icon { flex-shrink: 0; }
.convo-call-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.convo-call-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.convo-transcript { margin: 4px 0 0; font-size: 13.5px; }
.convo-texts { display: grid; gap: 4px; }
.convo-texts .bubble { max-width: 85%; }
.convo-texts .bubble.sent { justify-self: end; }
.recording { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.recording audio { height: 36px; flex: 1; min-width: 200px; max-width: 360px; }
td .recording { margin-top: 8px; }
td .recording audio { min-width: 220px; }
.recording-status { display: inline-block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.recording-status.failed { color: var(--red); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfdfd; font-size: 13.5px; color: #6f8a87; }
.pagination-summary b { color: var(--ink); font-weight: 600; }
.pagination-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-link { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #d8e6e4; border-radius: 6px; background: #fff; color: #2c645e; text-decoration: none; font-weight: 550; }
a.page-link:hover { background: #eaf7f5; }
.page-link.current { background: #1caaa9; border-color: #1caaa9; color: #fff; }
.page-link.disabled { color: #b5c6c3; background: #f7fbfb; }
.page-gap { padding: 0 4px; color: #9ab0ad; }
.events-table + .pagination, .card > .pagination:last-child { border-radius: 0 0 9px 9px; }
.pagination-compact { border-top: 0; border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; padding: 8px 10px; margin: -6px -6px 6px; }
.pagination-compact .page-link { height: 30px; min-width: 30px; }

/* Wide family profile */
.drawer { width: clamp(640px, 55vw, 1180px); max-width: 100vw; }
.drawer .modal-body { padding-left: 32px; padding-right: 32px; }
.drawer-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 40px; align-items: start; }
.drawer-columns > div > .client-section:first-child { margin-top: 0; }
.drawer-columns .client-section { margin-top: 26px; }
.section-link { float: right; font-size: 13px; font-weight: 500; }
.mini-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-row:last-child { border-bottom: 0; }
.mini-row svg { color: #50847f; margin-top: 2px; }
.mini-row p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.note-preview { white-space: pre-wrap; line-height: 1.6; color: #50665f; }
@media (max-width: 1000px) {
  .drawer-columns { grid-template-columns: minmax(0, 1fr); }
  .drawer-columns > div + div > .client-section:first-child { margin-top: 26px; }
}
@media (max-width: 700px) {
  .drawer { width: 100vw; }
  .drawer .modal-body { padding-left: 18px; padding-right: 18px; }
}

/* Intake drag and drop */
.lane-cards { min-height: 80px; display: grid; align-content: start; }
.lane-empty[hidden] { display: none; }
.lead-card { cursor: grab; user-select: none; -webkit-user-drag: none; }
.lead-card:active { cursor: grabbing; }
.lead-card-ghost { opacity: .35; outline: 2px dashed #1caaa9; outline-offset: -2px; }
.lead-card-chosen { box-shadow: 0 12px 30px #15372c30; }

/* S3 setup */
.copy-block { position: relative; margin: 10px 0 12px; border: 1px solid #d8e6e4; border-radius: 8px; background: #f7fbfb; }
.copy-block pre { margin: 0; padding: 14px 16px; font-size: 12.5px; line-height: 1.55; overflow-x: auto; color: #23504b; }
.copy-block .copy-btn { position: absolute; top: 8px; right: 8px; border: 1px solid #d8e6e4 !important; border-radius: 6px; }
.scope-checks .info svg { color: #7b9ca0; }
.scope-checks .info span { color: var(--muted); }
.two-cols + .drawer-columns { margin-top: 28px; }

/* Manual calling & texting without Zoom */
.dial-link { margin: 18px auto 0; }
.composer-off { display: grid; gap: 12px; justify-items: start; padding: 20px 24px; background: #f7fbfb; }
.composer-off p { line-height: 1.6; }

/* Settings: collapsible sections */
.settings-sections { display: grid; gap: 14px; }
.settings-section { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; scroll-margin-top: 20px; }
.settings-section > summary { display: flex; align-items: center; gap: 16px; padding: 20px 24px; cursor: pointer; list-style: none; }
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary:hover { background: #f7fbfb; }
.settings-section > summary:focus-visible { outline: 2px solid #1caaa9; outline-offset: -2px; }
.section-icon { width: 42px; height: 42px; border-radius: 10px; background: #e4f6f3; color: #187f7b; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.section-title { display: grid; gap: 3px; flex: 1; min-width: 0; }
.section-title b { font-family: Manrope, sans-serif; font-size: 17px; font-weight: 700; color: var(--ink); }
.section-title span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.section-status { flex-shrink: 0; }
.section-chevron { color: #7b9c99; transition: transform .2s; flex-shrink: 0; }
.settings-section[open] > summary { border-bottom: 1px solid var(--line); background: #fbfdfd; }
.settings-section[open] .section-chevron { transform: rotate(180deg); }
.section-body { padding: 22px 24px 26px; }
.section-body .zoom-status { margin-bottom: 18px; }
.section-body .setup-steps { gap: 0; }
.section-body .setup-step { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 24px 0; background: transparent; }
.section-body .setup-steps > .setup-step:first-child { border-top: 0; padding-top: 4px; }
.section-body .setup-step:last-child { padding-bottom: 0; }
.team-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.roles-list { margin-top: 18px; }
@media (max-width: 700px) {
  .settings-section > summary { padding: 16px; gap: 12px; flex-wrap: wrap; }
  .section-icon { width: 36px; height: 36px; }
  .section-title { flex-basis: calc(100% - 100px); }
  .section-status { order: 3; margin-left: 48px; }
  .section-body { padding: 18px 16px 22px; }
}
.section-body fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
@media (max-width: 560px) {
  .zoom-status { grid-template-columns: minmax(0, 1fr); }
  .zoom-status-item { border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .zoom-status-item:last-child { border-bottom: 0; }
}

/* Upload progress & locking */
.doc-row { flex-wrap: wrap; }
.doc-row.is-uploading .doc-upload, .doc-row.is-uploading .pill { display: none; }
.upload-progress { flex-basis: 100%; display: grid; gap: 6px; padding: 4px 0 2px 29px; font-size: 13px; color: #2c645e; font-weight: 550; }
.upload-progress progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 6px; background: #e4f1ef; overflow: hidden; }
.upload-progress progress::-webkit-progress-bar { background: #e4f1ef; border-radius: 6px; }
.upload-progress progress::-webkit-progress-value { background: #1caaa9; border-radius: 6px; transition: width .2s; }
.upload-progress progress::-moz-progress-bar { background: #1caaa9; border-radius: 6px; }
.upload-progress progress:indeterminate { background: linear-gradient(90deg, #e4f1ef 0%, #9fdcd6 50%, #e4f1ef 100%) 0 0 / 200% 100%; animation: upload-shimmer 1.2s linear infinite; }
.upload-progress progress:indeterminate::-webkit-progress-bar { background: transparent; }
@keyframes upload-shimmer { to { background-position: -200% 0; } }
.drawer.is-busy .tabs, .drawer.is-busy .head-actions, .drawer.is-busy .modal-head .icon-btn,
.drawer.is-busy .doc-row:not(.is-uploading) .doc-upload-label, .drawer.is-busy .doc-row:not(.is-uploading) .doc-remove,
.drawer.is-busy .doc-row:not(.is-uploading) .doc-link { pointer-events: none; opacity: .45; }
input:disabled + * , label:has(input:disabled) { cursor: not-allowed; }

/* PandaDoc settings */
.form-template-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 18px; }
.form-template-list > * { min-width: 0; }
.form-template-row fieldset { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(140px, 1fr) minmax(170px, 1fr) auto auto; gap: 14px; align-items: end;
  padding: 14px 16px; border: 1px solid var(--line) !important; border-radius: 8px; background: #fbfdfd; }
.form-template-name { display: flex; gap: 10px; align-items: center; align-self: center; }
.form-template-name svg { color: #50847f; }
.form-template-row .checkbox-field { padding-bottom: 10px; white-space: nowrap; }
.form-template-row .doc-remove { padding-bottom: 10px; }
.template-picker { display: grid; gap: 8px; }
.template-search { max-width: 420px; margin-bottom: 6px; }
.template-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.template-option > span:first-child { display: flex; align-items: center; gap: 8px; }
.token-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.template-setup { margin: -4px 0 4px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 10px 16px; }
.template-setup > summary { display: flex; gap: 8px; align-items: center; cursor: pointer; flex-wrap: wrap; }
.template-setup-body { padding-top: 14px; }
.template-setup .form-section-title { margin: 14px 0 10px; }
.token-map td { vertical-align: middle; }
.token-map select { width: 100%; max-width: 420px; }
.token-map select.needs-match { border-color: #d97757; }
.field-setup td { vertical-align: middle; }
.field-setup td:first-child { min-width: 180px; }
.field-setup input[type=text], .field-setup select { width: 100%; min-width: 150px; }
.field-setup .checkbox-field { white-space: nowrap; }
.move-stage p { margin: 0 0 16px; }
.move-stage .stage-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.move-next-form .move-next { width: 100%; justify-content: center; gap: 8px; padding: 12px; }
.move-pick { display: flex; gap: 10px; align-items: end; margin-top: 16px; }
.move-pick .field { flex: 1; margin: 0; }
.fill-from-picker { display: block; margin-top: 6px; width: 100%; font-size: 13px; color: var(--muted, #5f7470); }
.prefill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 16px; }
.prefill-field { align-self: end; }
.send-prefill { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.send-prefill > summary { cursor: pointer; font-weight: 600; }
.send-prefill .prefill-grid { margin-top: 12px; }
.send-prefill .notice { margin-top: 10px; }
@media (max-width: 900px) { .form-template-row fieldset { grid-template-columns: 1fr 1fr; } .form-template-name { grid-column: 1 / -1; } }

/* Intake forms on the family profile */
.intake-forms { margin-bottom: 26px; }
.section-btn { float: right; min-height: 32px; padding: 6px 12px; font-size: 13px; }
.form-request .button_to .link { font-size: 13px; }
.form-request-error { display: block; color: var(--red); font-size: 12.5px; margin-top: 3px; }
.checkbox-list { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.checkbox-list legend { margin-bottom: 8px; padding: 0; }
.checkbox-list .checkbox-field { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.instructions + form, .instructions + .notice { margin-top: 16px; }

/* Required documents settings */
.section-intro { line-height: 1.6; margin-bottom: 16px; }
.doc-type-list { display: grid; gap: 8px; }
.doc-type-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.doc-type-row.archived { justify-content: space-between; background: #fbfdfd; margin-top: 8px; }
.drag-handle { cursor: grab; color: #9bb5b2; font-size: 16px; letter-spacing: -3px; padding: 4px 2px; user-select: none; }
.doc-type-form { flex: 1; min-width: 0; }
.doc-type-form fieldset { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(160px, 1.3fr) auto; gap: 12px; align-items: center; }
.doc-type-form .field input { margin: 0; }
.required-toggle { white-space: nowrap; }
.doc-type-count { white-space: nowrap; min-width: 52px; text-align: right; }
.doc-type-add { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.3fr) auto auto; gap: 12px; align-items: end; margin-top: 18px;
  padding-top: 18px; border-top: 1px solid var(--line); }
.doc-type-add .checkbox-field { padding-bottom: 10px; white-space: nowrap; }
.archived-docs-head { margin: 26px 0 6px; font-size: 15px; }
@media (max-width: 900px) {
  .doc-type-row { flex-wrap: wrap; }
  .doc-type-form fieldset, .doc-type-add { grid-template-columns: 1fr; }
}
.doc-download { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.managed-pill { white-space: nowrap; }

/* Intake form */
.form-section-title { font-size: 15px; margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-body > .form-section-title:first-of-type, .form-errors + .form-section-title { margin-top: 0; padding-top: 0; border-top: 0; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.new-facility[hidden] { display: none; }
.pill.teal { background: #def3f2; color: #13706e; }
.pill.rose { background: #fbe9e7; color: #9a4a42; }
@media (max-width: 700px) { .form-grid.three { grid-template-columns: 1fr; } }
.detail-list .span-2 { grid-column: 1 / -1; }
.pre-line { white-space: pre-line; }
.insurance-list { margin-bottom: 4px; }

/* Intake stages & option lists */
.stage-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--stage); flex-shrink: 0; }
.stage-form fieldset { grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr) 110px 120px; }
.stage-form input, .stage-form select, .option-form input, .option-add input, .doc-type-form input {
  width: 100%; padding: 9px 11px; border: 1px solid #d8e6e4; border-radius: 6px; background: #fff; }
.stage-add { grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.3fr) 120px 130px auto; }
.option-form fieldset { grid-template-columns: 1fr; }
.option-list + .option-list { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.option-list-title { font-size: 16px; margin-bottom: 4px; }
.option-list > p { margin-bottom: 12px; }
.option-add { display: flex; gap: 10px; margin-top: 10px; max-width: 520px; }
.option-add input { flex: 1; }
.doc-type-row .button_to button[disabled] { opacity: .4; cursor: not-allowed; }
@media (max-width: 900px) { .stage-form fieldset, .stage-add { grid-template-columns: 1fr 1fr; } }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.info-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: #fff; }
.info-card.wide { grid-column: 1 / -1; }
.info-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.info-card header h3 { font-size: 15.5px; }
.info-card header .link { font-size: 13px; }
.card-links { display: flex; gap: 14px; }
.info-card dl { margin: 0; display: grid; gap: 10px; }
.info-card dl > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.info-card dt { font-size: 13px; color: var(--muted); }
.info-card dd { margin: 0; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.consent-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.consent-line .link { font-size: 13px; }
.info-card .mini-row:first-of-type { padding-top: 0; }
@media (max-width: 1000px) { .info-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .info-card dl > div { grid-template-columns: 1fr; gap: 2px; } }

/* Stage checklists — settings */
.stage-block + .stage-block { margin-top: 8px; }
.stage-checklist { margin: 6px 0 0 42px; }
.stage-checklist > summary { cursor: pointer; font-size: 13.5px; color: #3d7f78; font-weight: 600; padding: 4px 0; list-style-position: inside; }
.stage-checklist[open] > summary { margin-bottom: 8px; }
.checklist-editor { display: grid; gap: 6px; }
.checklist-item-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px dashed #d8e6e4; border-radius: 8px; background: #fbfdfd; }
.checklist-item-form { flex: 1; min-width: 0; }
.checklist-item-form fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(200px, 1fr) auto; gap: 10px; }
.checklist-item-form input, .checklist-item-form select, .checklist-item-add input, .checklist-item-add select {
  width: 100%; padding: 8px 10px; border: 1px solid #d8e6e4; border-radius: 6px; background: #fff; font-size: 14px; }
.checklist-item-add { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(190px, 1fr) minmax(170px, 1fr) auto; gap: 10px; margin: 10px 0 6px; }
@media (max-width: 900px) {
  .stage-checklist { margin-left: 0; }
  .checklist-item-form fieldset, .checklist-item-add { grid-template-columns: 1fr; }
}

/* Stage checklists — family profile & board */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checklist-step { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist-step:last-child { border-bottom: 0; }
.checklist-step .button_to { display: contents; }
.check-box { width: 24px; height: 24px; flex-shrink: 0; border-radius: 6px; border: 2px solid #b9cfcc !important; background: #fff !important;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: #fff; }
.check-box:hover { border-color: #1caaa9 !important; }
.check-box.checked, .check-box.auto { background: #1caaa9 !important; border-color: #1caaa9 !important; }
.check-box.auto { background: #7fcdc7 !important; border-color: #7fcdc7 !important; cursor: default; }
.check-box svg { width: 15px; height: 15px; stroke-width: 3; }
.step-text { display: grid; gap: 2px; padding-top: 2px; }
.step-name { font-size: 14.5px; }
.checklist-step.done .step-name { color: #6f8a87; }
.step-text small { font-size: 12.5px; color: var(--muted); }
.checklist.compact .checklist-step { padding: 5px 0; }
.checklist.compact .check-box { width: 20px; height: 20px; }
.all-stages { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.all-stages > summary { cursor: pointer; font-size: 13.5px; color: #3d7f78; font-weight: 600; }
.stage-steps { margin-top: 12px; }
.stage-steps h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.stage-steps.current h4 { color: #13706e; }
.lead-checklist { display: inline-flex; align-items: center; gap: 3px; color: #8aa3a0; font-size: 12px; }
.lead-checklist svg { width: 13px; height: 13px; }
.lead-checklist.complete { color: #1caaa9; font-weight: 600; }

/* Intake lane cards — just the essentials */
.lead-card .lead-name { display: block; font-size: 15px; font-weight: 650; color: var(--ink); margin-bottom: 8px; line-height: 1.3; }
.lead-details { margin: 0; display: grid; gap: 5px; }
.lead-details > div { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px; align-items: baseline; }
.lead-details dt { font-size: 10.5px; color: #8aa3a0; text-transform: uppercase; letter-spacing: .2px; }
.lead-details dd { margin: 0; font-size: 13.5px; color: #3c5552; overflow-wrap: break-word; }
.lead-details dd.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lead-details > div:last-child { grid-template-columns: 1fr; gap: 1px; margin-top: 2px; }
.sortable-fallback { opacity: .9 !important; box-shadow: 0 16px 36px #15372c33; transform: rotate(1.5deg); }

/* Team directory */
.team-table td { vertical-align: middle; }
.team-table .person small { display: block; }
.team-table .pill + .pill { margin-left: 6px; }
.team-table tr.is-deactivated td { color: #8aa3a0; }
.team-table tr.is-deactivated .avatar { opacity: .5; }
.team-table .actions-cell { text-align: right; }
.team-table .row-actions { display: inline-flex; align-items: center; white-space: nowrap; gap: 14px; }
.team-table .row-actions .link { font-size: 13px; }
.actions-col { width: 1%; }
.roles-details { margin-top: 18px; }
.roles-details > summary { cursor: pointer; font-weight: 600; color: #3d7f78; }
.roles-details .detail-list { margin-top: 10px; }

/* Sign in with Google */
.google-button { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; border: 1px solid #d5e3e0; color: #1f1f1f; font-weight: 600; min-height: 46px; }
.google-button:hover { background: #f6faf9; border-color: #b9cfcb; }
form.button_to:has(.google-button) { margin: 6px 0 0; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 6px; color: #7f9895; font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #dfe9e7; }

.zoom-dock-hint { margin: 0; padding: 6px 14px; font-size: 12px; color: #5f7a77; background: #f4f9f8; border-bottom: 1px solid #e3eeec; }
.zoom-dock-hint a { color: #2d8a80; font-weight: 600; }

/* Call recordings */
.recording-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.recording-filters .searchfield { flex: 1 1 260px; }
.field.compact { font-size: 12.5px; gap: 4px; min-width: 140px; }
.recordings-table td { vertical-align: middle; }
.recordings-table small { color: #6e8b89; font-size: 12.5px; }
.recordings-table small.block, .recordings-table .when small { display: block; }
.recordings-table .call-parties { display: grid; gap: 2px; margin-top: 6px; font-size: 13.5px; }
.recordings-table .player { display: flex; align-items: center; gap: 6px; min-width: 330px; }
.recordings-table audio { height: 36px; width: 280px; }
.empty-card { padding: 28px; display: grid; gap: 10px; justify-items: start; }

/* Wider intake lanes so card details aren't crammed; the board scrolls sideways when they don't all fit */
.board { grid-template-columns: repeat(var(--lanes, 5), minmax(320px, 1fr)); gap: 16px; scroll-snap-type: x proximity; scroll-padding-left: 2px; }
.lane { scroll-snap-align: start; padding: 14px; }

/* The board fits the screen; each lane scrolls on its own instead of the page growing */
.board { height: max(440px, calc(100dvh - 250px)); min-height: 0; align-items: stretch; }
.board .lane { display: flex; flex-direction: column; min-height: 0; align-self: stretch; }
/* Lanes only scroll vertically, so sideways scrolling over a lane moves the board to other lanes */
.board .lane-cards { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-x: auto; overscroll-behavior-y: contain; margin: 0 -6px; padding: 0 6px 4px; scrollbar-width: thin; }
.board .lane > .link.full-button { flex: none; }
.lead-details > div { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.lead-details dd { font-size: 14px; }
@media (max-width: 700px) {
  .board { grid-template-columns: repeat(var(--lanes, 5), 270px); }
}

/* Texts tab: live SMS thread + direct composer */
.sms-panel h3 .pill { margin-left: 6px; vertical-align: middle; }
.sms-thread { display: flex; flex-direction: column; gap: 2px; max-height: min(52vh, 520px); min-height: 220px; overflow-y: auto; padding: 14px 4px 10px; margin-bottom: 12px; background: #f7fbfa; border: 1px solid #e3eeec; border-radius: 10px; }
.sms-thread:has(.message-row) .thread-empty { display: none; }
.message-row { display: flex; flex-direction: column; align-items: flex-start; padding: 0 10px; }
.message-row.sent { align-items: flex-end; }
.message-row .bubble { max-width: 78%; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-row .message-time { margin-bottom: 8px; }
.sms-panel .composer textarea { width: 100%; resize: vertical; min-height: 76px; }
.unread-badge { background: #2fb3a5; color: #fff; }
.call-log .convo-call + .convo-call { border-top: 1px solid #e8f0ee; padding-top: 12px; margin-top: 12px; }

/* State workspace switcher (sidebar) */
.state-switcher { position: relative; margin-bottom: 4px; }
.state-switcher > summary { list-style: none; cursor: pointer; }
.state-switcher > summary::-webkit-details-marker { display: none; }
.state-switcher[open] > summary svg:last-child { transform: rotate(180deg); }
.state-switcher > summary .avatar { font-weight: 700; font-size: 12.5px; letter-spacing: .3px; }
.state-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid #dbe8e5; border-radius: 12px; box-shadow: 0 16px 40px #0f2a2626; padding: 8px; max-height: 70vh; overflow-y: auto; }
.state-menu-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: #7f9895; padding: 6px 10px 8px; margin: 0; }
.state-menu form.button_to { margin: 0; }
.state-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.state-option:hover, .state-option:focus-visible { background: #eef7f5; }
.state-option.current { background: #e3f4f0; }
.state-option > span:nth-child(2) { flex: 1; display: grid; }
.state-option small { color: #6e8b89; font-size: 12px; }
.state-code { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; background: #dff3eb; color: #1f6f66; font-weight: 700; font-size: 12.5px; letter-spacing: .3px; }
.state-code.all svg { width: 16px; height: 16px; }
.state-check { width: 16px; height: 16px; color: #2fb3a5; }
.state-manage { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 10px; border-top: 1px solid #e8f0ee; color: #3d7f78; font-weight: 600; font-size: 13.5px; text-decoration: none; }
.state-manage svg { width: 16px; height: 16px; }
.setting-row.is-archived { opacity: .6; }
.inline-add { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.inline-add select { max-width: 280px; }

/* Address autocomplete */
.address-field { position: relative; display: grid; gap: 6px; }
.address-suggestions { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 6px; list-style: none; background: #fff; border: 1px solid #d5e3e0; border-radius: 10px; box-shadow: 0 12px 30px #0f2a2622; }
.address-suggestions li { display: grid; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.address-suggestions li b { font-weight: 600; color: var(--ink); }
.address-suggestions li span { font-size: 12.5px; color: #6e8b89; }
.address-suggestions li:hover, .address-suggestions li.active { background: #eef7f5; }

/* Roles & permissions matrix */
.permissions-table td, .permissions-table th { vertical-align: middle; }
.permissions-table td small, .permissions-table th small { display: block; color: #6e8b89; font-size: 12.5px; font-weight: 400; margin-top: 2px; }
.permissions-table .role-col { text-align: center; width: 150px; }
.perm-check { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid #d5e3e0; background: #fff; color: #a7b8b5; padding: 0; cursor: pointer; }
.perm-check svg { width: 16px; height: 16px; }
.perm-check.on { background: #2fb3a5; border-color: #2fb3a5; color: #fff; }
.perm-check.locked { background: #dff3eb; border-color: #dff3eb; color: #1f6f66; cursor: default; }
span.perm-check { cursor: default; }

/* Fax inbox */
.fax-layout { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
.fax-list-card { padding: 6px; }
.fax-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.fax-row:hover { background: #f1f8f6; }
.fax-row.selected { background: #e3f4f0; }
.fax-row.unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: #2fb3a5; vertical-align: middle; }
.fax-row-body { display: grid; gap: 1px; }
.fax-row-body small { color: #6e8b89; font-size: 12.5px; }
.fax-row-body .fax-filed { color: #2d8a80; }
.fax-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #eef6f4; color: #3d7f78; flex: none; }
.fax-icon svg { width: 16px; height: 16px; }
.fax-viewer { padding: 18px; }
.fax-viewer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.fax-frame { width: 100%; height: min(70vh, 760px); border: 1px solid #e3eeec; border-radius: 8px; background: #f7fbfa; }
.fax-details { white-space: pre-wrap; font-size: 13px; background: #f7fbfa; padding: 12px; border-radius: 8px; max-height: 300px; overflow: auto; }
.fax-file-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #e8f0ee; }
.fax-file-form .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .fax-layout { grid-template-columns: 1fr; } .fax-file-form { grid-template-columns: 1fr; } }
.fax-access-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; border: 0; padding: 0; margin: 0; }
.fax-access-list .checkbox-field { display: flex; align-items: center; gap: 8px; }
.fax-intake { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 14px; padding: 14px; border-radius: 10px; background: #eef7f5; }
.fax-intake p { margin: 2px 0 0; }
.fax-source { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.fax-source svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* Roles & permissions */
.role-list { display: grid; gap: 12px; }
.role-card { border: 1px solid #e3eeec; border-radius: 10px; padding: 14px 16px; background: #fff; }
.role-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.role-card-head p { margin: 3px 0 0; }
.role-card-actions { display: inline-flex; gap: 12px; align-items: center; white-space: nowrap; }
.role-perms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.perm-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #f2f6f5; color: #9aaeab; text-decoration: line-through; }
.perm-chip.on { background: #e3f6ef; color: #237a6d; text-decoration: none; }
.perm-options { display: grid; gap: 8px; }
.perm-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #e3eeec; border-radius: 9px; cursor: pointer; }
.perm-option:has(input:checked) { border-color: #9fd9cf; background: #f2faf8; }
.perm-option input { margin-top: 3px; }
.perm-option span { display: grid; gap: 2px; }
.perm-option small { color: #6e8b89; font-size: 12.5px; }

/* Facility fax numbers */
.fax-facility-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; padding: 12px 14px; border-radius: 10px; background: #fbf6ea; border: 1px solid #f0e2bf; }
.fax-facility-form > .small { flex: 1 1 100%; }
.fax-facility-form select, .fax-facility-form input[type=text] { max-width: 260px; }
.facility-fax-numbers { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px 26px; }
.fax-number-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 999px; background: #eef6f4; color: #2c645e; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fax-number-chip svg { width: 12px; height: 12px; }
.fax-number-chip form { margin: 0; }
.chip-remove { border: 0; background: transparent; color: #7f9895; cursor: pointer; padding: 0 5px; font-size: 14px; line-height: 1; }
.chip-remove:hover { color: #ae6b5d; }
.fax-number-add { display: inline-flex; gap: 6px; align-items: center; }
.fax-number-add input { width: 150px; padding: 4px 8px; font-size: 12.5px; }
.doc-type-row:has(.facility-fax-numbers) { flex-wrap: wrap; }

/* Audit log */
.audit-table td { vertical-align: top; }
.audit-table small.block { display: block; color: #6e8b89; font-size: 12px; }
.audit-table .nowrap { white-space: nowrap; }

/* Split dialog: a fax beside the intake form */
.modal.modal-split { width: min(1560px, 97vw); height: 94vh; max-height: 94vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-split > .modal-head { flex: none; padding: 16px 24px; }
.split-dialog { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(460px, 1fr); }
.split-fax { display: flex; flex-direction: column; min-height: 0; background: #eef3f2; border-right: 1px solid var(--line); }
.split-fax-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); font-size: 14px; }
.split-fax-head svg { width: 16px; height: 16px; vertical-align: -3px; }
.split-fax-head small { color: #6e8b89; margin-left: 6px; }
.split-fax iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #e6ecea; }
.split-form { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.split-form > form { display: flex; flex-direction: column; flex: 1; }
.split-form .modal-body { flex: 1; }
.modal-split .modal-footer { position: sticky; bottom: 0; background: #fff; z-index: 2; box-shadow: 0 -6px 14px #0f2a260d; }
@media (max-width: 960px) {
  .modal.modal-split { height: auto; max-height: 96vh; overflow-y: auto; }
  .split-dialog { display: block; }
  .split-fax { height: 55vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .split-form { overflow: visible; }
}

/* ---- Family profile: centered popup (zooms in over a blurred page), or a full page ---- */
.drawer-scrim { justify-content: center; align-items: center; padding: 3vh 3vw; background: #0f2a2470; backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%); animation: scrim-in .18s ease-out; }
.drawer-scrim .drawer { width: min(1120px, 94vw); height: min(92vh, 1060px); max-height: 92vh; border-radius: 22px; overflow: auto;
  box-shadow: 0 30px 90px #0f2a2440, 0 0 0 1px #ffffff40; animation: profile-zoom-in .22s cubic-bezier(.2, .9, .3, 1.15); }
.drawer .modal-head { position: sticky; top: 0; z-index: 3; background: #fffffff2; backdrop-filter: blur(6px); }
.drawer .modal-head .icon-btn + .icon-btn { margin-left: -6px; }
@keyframes profile-zoom-in { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer-scrim, .drawer-scrim .drawer { animation: none; } }
/* Once the popup has opened, new content in it (another tab, a redraw after saving) doesn't replay the zoom. */
.modal-settled .drawer-scrim, .modal-settled .drawer-scrim .drawer { animation: none; }
@media (max-width: 700px) { .drawer-scrim { padding: 0; } .drawer-scrim .drawer { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; } }
.profile-page-wrap { max-width: 1200px; margin: 0 auto; padding: 8px 0 40px; }
.drawer.as-page { width: 100%; height: auto; max-height: none; overflow: visible; border-radius: 18px; box-shadow: 0 1px 3px #0f2a2414, 0 0 0 1px var(--line); }
.drawer.as-page .modal-head { top: 0; border-radius: 18px 18px 0 0; }

/* ---- Texts: a narrow reading column; the thread scrolls instead of growing the page ---- */
.sms-panel { max-width: 760px; margin-left: auto; margin-right: auto; }
.sms-thread { max-height: min(56vh, 560px); }
.messages { max-height: min(60vh, 560px); }
.messages > *, .messages .message-row { max-width: 760px; margin-left: auto; margin-right: auto; }
.message-row .bubble { max-width: min(75%, 520px); }

/* ---- "Intake forms not sent yet" banner on the family profile ---- */
.next-step-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(90deg, #fff7e8, #fffbf3); border: 1px solid #f1d9a6; }
.next-step-banner > svg { width: 22px; height: 22px; color: #b9822b; flex-shrink: 0; }
.next-step-banner .btn.primary { background: #149c98; border-color: #149c98; color: #fff; }
.next-step-banner .btn.primary:hover { background: #0f8783; border-color: #0f8783; color: #fff; }
.next-step-banner .btn.primary svg { color: #fff; }
.next-step-banner div { flex: 1; min-width: 0; }
.next-step-banner b { display: block; color: #5d4316; }
.next-step-banner p { margin: 2px 0 0; font-size: 13.5px; color: #7d6334; }
.next-step-banner.failed { background: #fff2f0; border-color: #f0c4bc; }
.next-step-banner.failed > svg, .next-step-banner.failed b { color: #9c3b2c; }
.docs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.docs-head h3 { margin: 0; }
.doc-row .pandadoc-actions { display: inline-flex; align-items: center; gap: 12px; }

/* ---- Settings: categories | settings | setup guide ---- */
.settings-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-shell.has-guide { grid-template-columns: 250px minmax(0, 1fr) minmax(300px, 380px); }
.settings-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px; }
.settings-nav-group { margin: 12px 10px 6px; font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: #8aa2a0; }
.settings-nav-group:first-child { margin-top: 4px; }
.settings-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: inherit; text-decoration: none; font-size: 14.5px; }
.settings-nav-item:hover { background: #f3f9f8; }
.settings-nav-item.active { background: #e6f5f3; color: #0a5d59; font-weight: 600; }
.settings-nav-item .section-icon { width: 30px; height: 30px; flex-shrink: 0; }
.settings-nav-item .nav-title { flex: 1; min-width: 0; }
.status-dot-sm { width: 8px; height: 8px; border-radius: 50%; background: #c9d6d4; flex-shrink: 0; }
.status-dot-sm.green { background: #2dc1bd; } .status-dot-sm.red { background: #e0705e; } .status-dot-sm.blue { background: #72a8d6; } .status-dot-sm.amber { background: #dfb45e; }
.settings-pane { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; }
.settings-pane[hidden] { display: none; }
.pane-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: #fbfdfd; }
.pane-head > div { flex: 1; min-width: 0; }
.pane-head h2 { font-size: 19px; margin: 0; }
.pane-head p { margin: 4px 0 0; font-size: 14px; color: #6e8b88; }
.settings-guide { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; background: #f7fbfa; border: 1px solid #e0ecea;
  border-radius: 14px; padding: 16px 18px; font-size: 14px; }
.settings-guide[hidden] { display: none; }
.guide-eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: #5f8c87; }
.guide-eyebrow svg { width: 14px; height: 14px; }
.guide-step { padding: 12px 0; border-top: 1px solid #e0ecea; }
.guide-step:first-of-type { border-top: 0; }
.guide-step h4 { margin: 0 0 8px; font-size: 14.5px; }
.guide-step .instructions { margin: 0; padding-left: 18px; }
.guide-step .instructions li { margin-bottom: 8px; line-height: 1.5; }
.guide-step .notice { margin-bottom: 10px; }
.guide-step pre, .guide-step code { white-space: pre-wrap; word-break: break-word; }
.guide-pointer { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 13px; color: #5f8c87; }
.guide-pointer svg { width: 14px; height: 14px; }
.settings-shell:not(.has-guide) .guide-pointer { display: none; }
@media (max-width: 1250px) {
  .settings-shell.has-guide { grid-template-columns: 230px minmax(0, 1fr); }
  .settings-shell.has-guide .settings-guide { grid-column: 2; position: static; max-height: none; }
}
@media (max-width: 860px) {
  .settings-shell, .settings-shell.has-guide { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .settings-nav-group { display: none; }
  .settings-nav-item { flex-shrink: 0; }
  .settings-shell.has-guide .settings-guide { grid-column: 1; }
}

/* ---- Account menu (name icon, top right) ---- */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 4px 2px 2px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: #eef7f5; }
.user-menu > summary svg { width: 16px; height: 16px; color: #6e8b89; transition: transform .15s; }
.user-menu[open] > summary svg { transform: rotate(180deg); }
.user-menu-panel { position: absolute; z-index: 60; right: 0; top: calc(100% + 8px); width: 240px; background: #fff; border: 1px solid #dbe8e5;
  border-radius: 12px; box-shadow: 0 16px 40px #0f2a2626; padding: 6px; }
.user-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid #e8f0ee; }
.user-menu-head > span { display: grid; min-width: 0; }
.user-menu-head b { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-head small { color: #6e8b89; font-size: 12.5px; }
.user-menu form.button_to { margin: 0; }
.user-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.user-menu-item svg { width: 17px; height: 17px; color: #5c8a85; }
.user-menu-item:hover, .user-menu-item:focus-visible { background: #eef7f5; }
.user-menu-item.current { background: #e3f4f0; }

/* ---- Intake pipeline: a slim header so the lanes get the screen ---- */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.board-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.board-title h1 { font-size: 22px; letter-spacing: -.4px; color: #0a222e; margin: 0; }
.board-filters { flex-wrap: wrap; margin-bottom: 14px; gap: 8px; }
.board-filters .searchfield { flex: 1 1 220px; max-width: 280px; padding-top: 8px; padding-bottom: 8px; }
.board-filters select { padding: 8px 30px 8px 10px; font-size: 14px; max-width: 220px; }
/* A filter that's set is highlighted, and Reset appears, as soon as it changes (the form itself isn't redrawn). */
.board-filters select:has(option:checked:not([value=""])) { border-color: #1caaa9; background-color: #eaf8f6; color: #0f6f6b; font-weight: 600; }
.board-filters .reset-filters { display: none; align-items: center; gap: 6px; padding: 8px 12px; font-size: 14px; }
.board-filters .reset-filters svg { width: 15px; height: 15px; }
.board-filters:has(select option:checked:not([value=""]), input[type=search]:not(:placeholder-shown)) .reset-filters { display: inline-flex; }
.board-filter-status { font-size: 13px; color: #5c7f7b; margin: -4px 0 10px; }
.board.is-filtered { height: max(420px, calc(100dvh - 278px)); }
.board { grid-template-columns: repeat(var(--lanes, 5), minmax(280px, 1fr)); gap: 12px; }
.board .lane { padding: 10px; }
.board .lane-head { margin: 2px 2px 10px; }
.board .lead-card { padding: 11px 12px; margin-bottom: 8px; }
.lead-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; margin-bottom: 6px; }
.lead-top .lead-name { flex: 1 0 auto; max-width: 100%; }
.lead-top .lead-name { margin-bottom: 0; }
@media (max-width: 700px) { .board, .board.is-filtered { height: auto; } .board-filters select { flex: 1 1 45%; max-width: none; } }

/* ---- "Not your client" badges ---- */
.owner-badge { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 2px 8px 2px 3px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap; vertical-align: middle; }
.owner-badge .avatar { width: 18px; height: 18px; font-size: 9px; }
.owner-badge svg { width: 13px; height: 13px; margin-left: 3px; }
.owner-badge.other { background: #efeaf7; color: #6a5394; }
.owner-badge.covering { background: #fdf1dc; color: #94620f; padding-left: 4px; }
.owner-badge.unassigned { background: #eef2f2; color: #6e8582; padding-left: 4px; }
td .person .owner-badge { margin-left: 4px; }

/* ---- Account menu: vacation ---- */
.user-menu-item > span:first-of-type { flex: 1; }
.user-menu-item .pill { font-size: 11px; padding: 1px 7px; }
.vacation-pill { font-size: 11px; margin-right: 2px; }

/* ---- Bigger intake form ---- */
.modal.modal-wide { width: min(1120px, 95vw); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-wide > .modal-head { flex: none; }
.modal-wide > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-wide .modal-body { overflow-y: auto; flex: 1; min-height: 0; padding: 24px 32px; }
.modal-wide .modal-footer { flex: none; background: #fff; box-shadow: 0 -6px 14px #0f2a260d; }
.modal-wide .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.modal-wide .form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .modal-wide .form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .modal-wide .form-grid, .modal-wide .form-grid.three { grid-template-columns: 1fr; } }

/* Dialog footers wrap instead of pushing buttons out of view */
.modal-footer { flex-wrap: wrap; }

.upload-targets { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.upload-targets .checkbox-field { font-size: 14px; color: var(--ink); }

/* ---- Team chat ---- */
#chat-nav-badge.is-empty, #chat-topbar-badge.is-empty, .chat-menu > summary .badge.is-empty { display: none; }
.chat-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: calc(100dvh - 76px - 50px); min-height: 480px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.chat-sidebar { display: flex; flex-direction: column; min-height: 0; background: #f6faf9; border-right: 1px solid var(--line); }
.chat-sidebar-head { padding: 18px 18px 8px; }
.chat-sidebar-head h1 { font-size: 19px; margin: 0; color: #0a222e; }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.chat-list-section { margin-top: 12px; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 4px; font-size: 12px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .5px; color: #6e8b89; }
.chat-list-head .icon-btn { width: 26px; height: 26px; }
.chat-list-head .icon-btn svg { width: 15px; height: 15px; }
.chat-list-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; color: #3c5552; font-size: 14.5px; text-decoration: none; }
.chat-list-item:hover { background: #eaf3f1; }
.chat-list-item.active { background: #d9efea; color: #0b4f4b; font-weight: 650; }
.chat-list-item.has-unread .chat-list-name { font-weight: 700; color: var(--ink); }
.chat-list-item.is-joinable { color: #8aa3a0; }
.chat-list-item .avatar { width: 24px; height: 24px; font-size: 10.5px; }
.chat-list-mark { width: 24px; display: inline-grid; place-items: center; color: #7b9a96; font-weight: 700; }
.chat-list-mark svg { width: 15px; height: 15px; }
.chat-list-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-empty { margin: 2px 8px; font-size: 13px; color: #8aa3a0; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.chat-head h2 { font-size: 18px; margin: 0; }
.chat-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.chat-head-actions { display: flex; gap: 8px; flex: none; }
.chat-head-actions form.button_to { margin: 0; }
/* Messages fill from the bottom (like Slack): the scroll box is a column and the list sits at its end. */
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 16px 22px 4px; }
.chat-messages { margin-top: auto; display: flex; flex-direction: column; }
.chat-start { color: var(--muted); font-size: 14px; padding: 8px 0 14px; }
.chat-messages:has(.chat-message) .chat-start { display: none; }
.chat-older { align-self: center; font-size: 13px; margin-bottom: 10px; }
.chat-message { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; }
.chat-message:hover { background: #f6faf9; }
.chat-message > .avatar { width: 36px; height: 36px; font-size: 13px; }
.chat-message.is-continued { padding-top: 1px; }
.chat-message.is-continued > .avatar, .chat-message.is-continued > .presence-avatar { visibility: hidden; height: 0; }
.chat-message.is-continued .chat-message-meta { display: none; }
.chat-message-meta { display: flex; align-items: baseline; gap: 8px; }
.chat-message-meta b { font-size: 14.5px; color: var(--ink); }
.chat-message-meta time { font-size: 12px; color: #8aa3a0; }
.chat-message-actions { margin-left: auto; display: none; gap: 12px; }
.chat-message.is-mine:hover .chat-message-actions { display: inline-flex; }
.chat-message-actions .link { font-size: 12.5px; }
.chat-message-actions form.button_to { margin: 0; }
.chat-message-actions .danger { color: #b5483a; }
.chat-text { font-size: 14.5px; line-height: 1.55; color: #24403d; overflow-wrap: anywhere; }
.chat-text p { margin: 0; }
.chat-text a { color: #0f7f7a; text-decoration: underline; }
.chat-text .mention { background: #e3f4f0; color: #0b6e69; font-weight: 600; border-radius: 4px; padding: 0 3px; }
.chat-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chat-image img { display: block; max-width: 320px; max-height: 240px; border-radius: 10px; border: 1px solid var(--line); }
.chat-file { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfd; color: var(--ink); text-decoration: none; }
.chat-file svg { width: 20px; height: 20px; color: #149c98; }
.chat-file span { display: grid; font-size: 13.5px; }
.chat-file small { color: var(--muted); font-size: 12px; }
.chat-edit { display: grid; gap: 8px; }
.chat-edit textarea { width: 100%; font-size: 14.5px; }
.chat-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.chat-composer { padding: 8px 22px 14px; }
.chat-composer-box { border: 1px solid #cfe1de; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px #0f2a2608; }
.chat-composer-box:focus-within { border-color: #1caaa9; box-shadow: 0 0 0 3px #1caaa922; }
.chat-composer textarea { width: 100%; border: 0; resize: none; padding: 12px 14px 4px; font-size: 14.5px; line-height: 1.5; max-height: 220px; background: transparent; outline: none; }
.chat-composer-tools { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; }
.chat-composer-tools label.icon-btn { cursor: pointer; }
.chat-picked { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-send { margin-left: auto; padding: 7px 14px; }
.chat-hint { margin: 6px 2px 0; }
.chat-error { margin: 0 0 6px; color: #b5483a; font-size: 13px; }
.chat-join { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); background: #f6faf9; }
.chat-join p { margin: 0; font-size: 14px; }
.chat-join form.button_to { margin: 0; }
.chat-empty { margin: auto; max-width: 440px; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 30px; }
.chat-empty > svg { width: 40px; height: 40px; color: #1caaa9; }
.chat-empty h2 { margin: 0; }
.chat-empty p { color: var(--muted); margin: 0; }
.chat-empty-actions { display: flex; gap: 8px; margin-top: 6px; }
.people-picker input[type=search] { width: 100%; margin-bottom: 8px; }
.people-picker-list { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; }
.people-option { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.people-option:hover { background: #f1f8f6; }
.people-option[hidden] { display: none; }
.people-option span { display: grid; }
.people-option small { color: var(--muted); font-size: 12.5px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: #eef5f4; font-size: 13.5px; }
.member-chip .avatar { width: 22px; height: 22px; font-size: 10px; }
@media (max-width: 800px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; }
  .chat-pane { height: calc(100dvh - 120px); }
}

/* ---- Presence and typing ---- */
.presence-avatar { position: relative; display: inline-flex; flex: none; }
.presence-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #c5d3d1; border: 2px solid #fff; }
.presence-avatar.is-online .presence-dot, .presence-line.is-online .presence-dot { background: #22b573; }
.chat-list-item .presence-dot { width: 9px; height: 9px; border-color: #f6faf9; }
.chat-list-item.active .presence-dot { border-color: #d9efea; }
.chat-message.is-continued > .presence-avatar { visibility: hidden; height: 0; }
.chat-message > .presence-avatar .avatar { width: 36px; height: 36px; font-size: 13px; }
.member-chip .presence-dot, .owner-badge .presence-dot { width: 8px; height: 8px; border-width: 1.5px; }
.presence-line { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.presence-line .presence-dot { position: static; width: 8px; height: 8px; border: 0; }
.presence-line.is-online { color: #1a8f5c; }
.chat-typing { min-height: 20px; padding: 0 22px; font-size: 12.5px; color: #6e8b89; display: flex; align-items: center; gap: 6px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: #8aa3a0; animation: typing-bounce 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; } }

/* ---- Zoom Phone button in the top bar ---- */
.zoom-launcher { position: relative; }
html[data-zoom-open] .zoom-launcher { background: #e3f4f0; color: #0b6e69; }
.zoom-launcher .call-dot { display: none; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #22b573; box-shadow: 0 0 0 2px #fff; }
html[data-zoom-call] .zoom-launcher .call-dot { display: block; animation: call-pulse 1.6s infinite; }
@keyframes call-pulse { 0% { box-shadow: 0 0 0 2px #fff, 0 0 0 2px #22b57399; } 70% { box-shadow: 0 0 0 2px #fff, 0 0 0 8px #22b57300; } 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 2px #22b57300; } }
@media (prefers-reduced-motion: reduce) { html[data-zoom-call] .zoom-launcher .call-dot { animation: none; } }
@media (max-width: 700px) { .zoom-dock { top: 64px; right: 12px; } }

/* ---- Chat windows docked at the bottom right (Gmail-style) ---- */
.chat-dock { position: fixed; right: 18px; bottom: 0; z-index: 50; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 12px; pointer-events: none; }
.chat-window { width: 330px; height: 460px; max-height: calc(100dvh - 90px); display: flex; flex-direction: column; background: #fff; pointer-events: auto;
  border-radius: 14px 14px 0 0; box-shadow: 0 8px 40px #0f2a2633, 0 0 0 1px #0f2a2614; overflow: hidden; }
.chat-window[hidden], .chat-window.is-overflow { display: none; }
.chat-window > turbo-frame { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-window.is-minimized { height: auto; width: 260px; }
.chat-window-loading { padding: 16px; font-size: 13px; color: var(--muted); }
.chat-window-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-window-head { display: flex; align-items: center; gap: 9px; padding: 8px 6px 8px 12px; background: #0f5f5c; color: #fff; cursor: pointer; flex: none; }
.chat-window.has-new .chat-window-head { background: #149c98; animation: chat-new 1.4s ease-in-out 2; }
@keyframes chat-new { 50% { background: #22b5a9; } }
.chat-window-head .avatar { width: 28px; height: 28px; font-size: 11px; }
.chat-window-head .presence-dot { border-color: #0f5f5c; }
.chat-window-head .chat-list-mark { color: #bfe7e2; }
.chat-window-title { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.chat-window-title b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-window-title .presence-line { margin: 0; font-size: 11.5px; color: #bfe7e2; }
.chat-window-title .presence-line.is-online { color: #9ff0c8; }
.chat-window-title .presence-line .presence-dot { display: none; }
.chat-window-actions { display: flex; flex: none; }
.chat-window-actions .icon-btn { width: 30px; height: 30px; color: #e3f4f0; background: transparent; border: 0; }
.chat-window-actions .icon-btn:hover { background: #ffffff22; }
.chat-window-actions .icon-btn svg { width: 16px; height: 16px; }
.chat-window.is-minimized .chat-window-body, .chat-window.is-minimized .chat-window-actions .icon-btn:nth-child(2) { display: none; }
.chat-window.is-minimized .chat-window-actions .icon-btn:first-child svg { transform: rotate(180deg); }
.chat-window-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-window .chat-scroll { padding: 10px 12px 4px; }
.chat-window .chat-message { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 4px 6px; margin: 0 -6px; }
.chat-window .chat-message > .presence-avatar .avatar, .chat-window .chat-message > .avatar { width: 28px; height: 28px; font-size: 11px; }
.chat-window .chat-message-meta b { font-size: 13.5px; }
.chat-window .chat-text { font-size: 14px; }
.chat-window .chat-image img { max-width: 220px; max-height: 180px; }
.chat-window .chat-typing { padding: 0 12px; min-height: 18px; font-size: 12px; }
.chat-window .chat-composer { padding: 4px 10px 10px; }
.chat-composer.is-compact textarea { padding: 9px 10px 2px; font-size: 14px; }
.chat-composer.is-compact .chat-composer-tools { padding: 2px 6px 6px; }
.chat-composer.is-compact .chat-send { padding: 6px 10px; }
.chat-error:empty { display: none; }
.chat-window .chat-join { padding: 10px 12px; }
/* Chat button and drop-down in the top bar */
.chat-menu { position: relative; }
.chat-menu > summary { list-style: none; position: relative; cursor: pointer; }
.chat-menu > summary::-webkit-details-marker { display: none; }
.chat-menu > summary .badge { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; line-height: 18px; border-radius: 999px; background: #149c98; color: #fff; text-align: center; }
.chat-menu[open] > summary { background: #e3f4f0; color: #0b6e69; }
.chat-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 300px; background: #fff; border: 1px solid #dbe8e5; border-radius: 12px; box-shadow: 0 16px 40px #0f2a2626; padding: 8px; }
.chat-menu-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 8px 8px; border-bottom: 1px solid #e8f0ee; margin-bottom: 6px; }
.chat-menu-head span { font-size: 12.5px; }
.chat-roster-list { display: grid; gap: 1px; max-height: 360px; overflow-y: auto; }
.chat-roster-list .chat-list-item { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.chat-roster-list .presence-dot { border-color: #fff; }
@media (max-width: 700px) {
  .chat-dock { right: 0; left: 0; gap: 0; justify-content: flex-start; }
  .chat-window { width: 100vw; border-radius: 0; }
}
.chat-message > .presence-avatar { align-self: start; }
.send-text-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: #1f6f66; }
.send-text-line.muted { color: var(--muted); }
.send-text-line svg { width: 16px; height: 16px; flex: none; }
/* Facility PCP details and doctors (Settings → Intake options) */
#options-facilities .doc-type-row { flex-wrap: wrap; }
.facility-pcp { flex-basis: 100%; margin-top: 2px; }
.facility-pcp > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: #3d7f78; }
.facility-pcp > summary svg { width: 15px; height: 15px; }
.facility-pcp-body { padding: 10px 0 4px 22px; display: grid; gap: 10px; }
.facility-pcp-form fieldset { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; border: 0; padding: 0; margin: 0; }
.facility-pcp-form .field.compact { min-width: 150px; flex: 1 1 150px; max-width: 200px; }
.facility-physicians { display: flex; flex-wrap: wrap; gap: 6px; }
.facility-physician-add { display: flex; flex-wrap: wrap; gap: 8px; }
.facility-physician-add input[name=name] { flex: 1 1 240px; }
.facility-physician-add input[name=npi] { width: 150px; }
.pcp-name-field { display: flex; flex-direction: column; gap: 7px; }
.pcp-name-field select[hidden], .pcp-name-field input[hidden] { display: none; }

/* ---- Intake options: columns (list → facility → part → editor) ---- */
.options-browser { display: block; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.ob-columns { display: flex; align-items: stretch; min-height: 460px; overflow-x: auto; scrollbar-width: thin; }
.ob-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: #6e8b89; background: #f6faf9; }
.ob-trail a { color: #2d7f78; text-decoration: none; font-weight: 600; }
.ob-trail a:hover { text-decoration: underline; }
.ob-trail svg { width: 13px; height: 13px; color: #a3b8b5; }
.ob-trail b { color: var(--ink); }
/* Four levels deep, the first column gives way to the trail above (and, on smaller screens, the facilities too). */
.options-browser.depth-4 .ob-lists { display: none; }
@media (max-width: 1400px) { .options-browser.depth-4 .ob-facilities { display: none; } }
.ob-col { flex: none; width: 178px; padding: 12px 8px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; background: #fbfdfd; }
.ob-col.ob-facilities { width: 210px; }
.ob-col.ob-editor { flex: 1 0 auto; width: 0; min-width: 380px; padding: 16px 20px; background: #fff; border-right: 0; gap: 10px; }
.ob-col.ob-empty { flex: 1 1 auto; width: auto; border-right: 0; background: #fff; justify-content: center; align-items: center; text-align: center; color: var(--muted); font-size: 14px; padding: 30px; }
.ob-editor .ob-empty { margin: auto; text-align: center; color: var(--muted); font-size: 14px; }
.ob-col-title { margin: 0 6px 6px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .5px; color: #7f9895; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-item { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-radius: 8px; color: #33504d; font-size: 14px; text-decoration: none; }
.ob-item > span:first-child { flex: 1; min-width: 0; display: grid; }
.ob-item small { font-size: 12px; color: #8aa3a0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-item svg { width: 15px; height: 15px; color: #a3b8b5; flex: none; }
.ob-item:hover { background: #eef6f4; }
.ob-item.active { background: #d9efea; color: #0b4f4b; font-weight: 650; }
.ob-item.active svg { color: #149c98; }
.ob-count { font-size: 12px; color: #6e8b89; background: #e8f0ee; border-radius: 999px; padding: 0 7px; }
.ob-note { margin: 6px 10px; font-size: 13px; color: #8aa3a0; }
.ob-add { display: flex; gap: 4px; margin-top: 8px; padding: 0 2px; }
.ob-add input { flex: 1; min-width: 0; padding: 7px 9px; font-size: 13.5px; }
.ob-archived { margin-top: auto; padding: 8px 6px 0; font-size: 13px; color: var(--muted); }
.ob-archived summary { cursor: pointer; }
.ob-archived-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 0; }
.ob-archived-row form.button_to { margin: 0; }
.ob-editor-title { margin: 0; font-size: 17px; }
.ob-editor .option-list { margin: 0; }
.ob-form fieldset { display: grid; gap: 14px; max-width: 420px; border: 0; padding: 0; margin: 0; }
.ob-form .step-actions { justify-content: flex-start; margin: 0; }
.ob-danger { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.ob-danger form.button_to { margin: 0; }
.ob-rows { display: grid; gap: 6px; }
.ob-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfd; }
.ob-row > svg { width: 16px; height: 16px; color: #5c8a85; flex: none; }
.ob-row > span { flex: 1; }
.ob-row form.button_to { margin: 0; }
.ob-col.ob-editor > * { min-width: 0; }
.ob-physician { flex-wrap: wrap; }
.ob-physician fieldset { flex: 1 1 260px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 0; padding: 0; margin: 0; min-width: 0; }
.ob-physician input[name=name] { flex: 1 1 140px; min-width: 0; padding: 7px 9px; }
.ob-physician input[name=npi] { flex: 0 1 120px; min-width: 0; padding: 7px 9px; font-variant-numeric: tabular-nums; }
.ob-inline-form input[name=name] { min-width: 0; }
.ob-inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ob-inline-form input[name=name] { flex: 1 1 220px; }
.ob-inline-form input[name=npi], .ob-inline-form input[name=number] { width: 170px; }
@media (max-width: 860px) {
  .ob-columns { flex-direction: column; overflow: visible; }
  .options-browser.depth-4 .ob-facilities, .options-browser.depth-3 .ob-lists { display: none; }
  .ob-col, .ob-col.ob-facilities { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .ob-col.ob-editor { min-width: 0; }
}

/* Read receipts under the newest message */
.chat-receipts { display: flex; align-items: center; justify-content: flex-end; gap: 3px; padding: 2px 4px; font-size: 11.5px; color: #6e8b89; }
.chat-receipts[hidden] { display: none; }
.chat-receipt { display: inline-flex; }
.chat-receipt[hidden] { display: none; }
.chat-receipt .avatar { width: 16px; height: 16px; font-size: 7.5px; }
.chat-receipt-label { margin-left: 4px; }

/* Pull uploaded files from a signed form */
.upload-pull-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.upload-pull { border: 1px solid #e3ecea; border-radius: 12px; padding: 10px 14px 12px; margin: 0 0 12px; }
.upload-pull legend { padding: 0 6px; }
.upload-pull .is-on-file { opacity: .6; }

/* ASD evaluators (Settings) and referrals */
.evaluator-row .doc-type-form fieldset { grid-template-columns: minmax(150px, 1fr) minmax(130px, .8fr) minmax(180px, 1.2fr); }
.evaluator-add { grid-template-columns: minmax(150px, 1fr) minmax(130px, .8fr) minmax(180px, 1.2fr) auto; }
.form-grid .field.wide { grid-column: 1 / -1; }
.form-grid .field small.tiny { font-weight: 400; }
@media (max-width: 900px) { .evaluator-row .doc-type-form fieldset, .evaluator-add { grid-template-columns: 1fr; } }
.evaluation-card .mini-row p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.evaluation-card .inline-link { padding: 0; font: inherit; }

/* Evaluator area */
.portal-page { background: var(--bg, #f4f8f8); min-height: 100vh; }
.portal-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.portal-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 600; }
.portal-brand .official-logo { height: 34px; width: auto; }
.portal-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.portal-main { max-width: 1040px; margin: 0 auto; padding: 28px 24px 60px; }
.portal-main > .notice { margin-bottom: 16px; }
.portal-head { margin: 8px 0 20px; }
.portal-head h1 { font-size: 24px; margin: 0 0 6px; }
.portal-table { width: 100%; }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.portal-card { padding: 20px; }
.portal-card.wide { grid-column: 1 / -1; }
.portal-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.portal-card h2 { font-size: 16px; margin: 0; }
.portal-details { display: grid; gap: 8px; margin: 0 0 10px; }
.portal-details div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.portal-details dt { color: var(--muted, #5f7a77); font-size: 13px; }
.portal-details dd { margin: 0; }
.portal-upload { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
@media (max-width: 760px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-bar { padding: 12px 16px; }
  .portal-brand span { display: none; }
  .portal-main { padding: 20px 16px 48px; }
  .portal-details div { grid-template-columns: 1fr; gap: 2px; }
  .table-card { overflow-x: auto; }
}
.two-step-steps { padding-left: 20px; margin: 0 0 14px; display: grid; gap: 10px; font-size: 14px; line-height: 1.5; }
.qr-code { width: 184px; margin: 10px 0 6px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.qr-code img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.otp-key { display: inline-block; margin-top: 4px; font-size: 13px; letter-spacing: .5px; word-break: break-all; }
.code-input { font-size: 18px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.recovery-codes { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 28px; }
.recovery-codes code { font-size: 15px; letter-spacing: 1px; }
.method-choices { display: grid; gap: 10px; margin-top: 4px; }
.method-choice { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; background: #fff; }
.method-choice:hover, .method-choice:focus-visible { border-color: #2fb3a5; box-shadow: 0 0 0 3px rgb(47 179 165 / 15%); }
.method-choice small { color: var(--muted, #5f7a77); font-size: 13px; line-height: 1.45; }
.code-links { display: flex; justify-content: center; gap: 16px; }

/* Client directory filters */
.client-filters { flex-wrap: wrap; }
.client-filters select { max-width: 200px; height: 38px; }
.filter-summary { display: flex; gap: 12px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line); background: #f7fbfa; color: #4e6b68; }

/* Client profile (families in care) */
.client-status { font-weight: 600; align-self: center; height: auto; }
.mini-row.past { opacity: .75; }
.attention-text { color: var(--red, #c0574c); font-weight: 600; }

/* ---- Family & client profile ----
   Header: who, and one-click ways to reach them. Intake families get a progress track under it.
   Tabs across the top; the facts panel (status, parent, insurance, care) sits beside every tab. */
.drawer-scrim .drawer { width: min(1320px, 96vw); }
.profile-page-wrap { max-width: 1360px; }
.drawer .modal-head { gap: 18px; justify-content: flex-start; flex-wrap: wrap; padding: 22px 32px; }
.drawer .modal-head > .avatar { width: 58px; height: 58px; font-size: 19px; flex-shrink: 0; }
.drawer .modal-head .modal-title { flex: 1 1 280px; min-width: 0; }
.drawer .modal-head .modal-title h2 { font-size: 28px; letter-spacing: -.7px; line-height: 1.15; color: #17322f; }
.drawer .modal-head .modal-title p { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 7px; }
.profile-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: #4e6865; }
.profile-chip svg { width: 16px; height: 16px; color: #82a6a1; }
.head-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.head-buttons form.button_to { margin: 0; display: contents; }
.head-buttons .btn { min-height: 42px; padding: 10px 16px; font-size: 15px; border-radius: 10px; }
.head-buttons .btn svg { width: 17px; height: 17px; }
.head-buttons .btn.icon-only { padding: 10px 11px; }
.profile-more > summary { list-style: none; }
.profile-more > summary::-webkit-details-marker { display: none; }
.profile-more[open] > summary { background: #eef7f5; }
.profile-more .user-menu-panel { width: 260px; }
.user-menu-item.danger, .user-menu-item.danger svg { color: var(--red); }
@media (max-width: 1050px) { .head-buttons { order: 10; flex-basis: 100%; } }

.family-profile { padding-top: 0; }
.drawer .modal-body.family-profile { padding-top: 0; }

/* Intake progress: every stage in order; done stages filled with their color. */
.journey { margin: 0 -32px; padding: 20px 32px 22px; background: linear-gradient(180deg, color-mix(in srgb, var(--stage) 9%, #fff), #fff);
  border-bottom: 1px solid var(--line); }
.journey-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.journey-step { font-size: 14px; font-weight: 600; color: #557370; width: 100%; }
.journey-head h3 { font-size: 21px; letter-spacing: -.4px; }
.journey-check { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 14.5px; font-weight: 600; color: #0b6e69; text-decoration: none; }
.journey-check:hover { text-decoration: underline; }
.journey-check svg { width: 17px; height: 17px; }
.journey-track { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.journey-track li { display: grid; gap: 7px; font-size: 13px; color: #8a9e9b; min-width: 0; }
.journey-track li::before { content: ""; height: 8px; border-radius: 99px; background: #e3ecea; }
.journey-track li.done::before { background: color-mix(in srgb, var(--stage) 70%, #fff); }
.journey-track li.current::before { background: var(--stage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage) 22%, transparent); }
.journey-track li.done { color: #557370; }
.journey-track li.current { color: #17322f; font-weight: 650; }
.journey-track li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 800px) { .journey-track li:not(.current) span { visibility: hidden; } .journey-track li.current { overflow: visible; } }

.inactive-banner { display: flex; align-items: center; gap: 12px; margin: 0 -32px; padding: 14px 32px; background: #f3f5f5; border-bottom: 1px solid var(--line); color: #4e6462; font-size: 14.5px; }
.inactive-banner svg { width: 20px; height: 20px; color: #7d908e; }

/* Tabs */
.profile-tabs { display: flex; gap: 4px; margin: 0 -32px; padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.profile-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 15px 12px 14px; font-size: 15.5px; font-weight: 600;
  color: #5a7471; text-decoration: none; white-space: nowrap; }
.profile-tab:hover { color: #17322f; }
.profile-tab.active { color: #0b6e69; }
.profile-tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: #149c98; }
.tab-count { font-size: 12.5px; font-weight: 650; color: #557370; background: #edf3f2; border-radius: 999px; padding: 1px 8px; }
.tab-count.attention { background: #fdf1dc; color: #94620f; }
.tab-count.unread { background: #149c98; color: #fff; }

/* Main column + facts panel */
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; padding-top: 26px; }
.profile-main { min-width: 0; }
.profile-main > .next-step-banner { margin-bottom: 20px; }

.profile-facts { position: sticky; top: 112px; display: grid; gap: 0; padding: 6px 22px; border-radius: 16px; background: #f5f9f8; border: 1px solid #e5eeec; }
.facts-group { display: grid; gap: 8px; padding: 18px 0; border-bottom: 1px solid #e3ecea; }
.facts-group:last-of-type { border-bottom: 0; }
.facts-group h3 { font-family: "DM Sans", sans-serif; font-size: 13.5px; font-weight: 650; color: #6a8380; letter-spacing: 0; }
.facts-status { gap: 12px; }
.facts-status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.facts-status .client-status { font-size: 14px; padding: 4px 12px; }
.fact-picker label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 650; color: #6a8380; }
.fact-picker select { width: 100%; padding: 10px 34px 10px 12px; border: 1px solid #d5e4e1; border-radius: 10px; background-color: #fff;
  font-size: 15px; font-weight: 600; color: var(--ink); }
.fact-picker select[name="client[intake_stage_id]"] { border-left: 5px solid var(--stage); }
.facts-owner .owner-badge { font-size: 13px; }
.fact-lead { font-size: 17px; font-weight: 650; color: #17322f; line-height: 1.3; overflow-wrap: anywhere; }
.fact-lead span { font-size: 14px; font-weight: 500; color: #6a8380; }
.fact-line { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; font-size: 15px; color: #2a4744;
  text-decoration: none; text-align: left; cursor: pointer; }
p.fact-line { cursor: default; }
.fact-line > span:not(.pill) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact-line svg { width: 17px; height: 17px; color: #6fa09a; }
a.fact-line:hover, button.fact-line:hover { color: #0b6e69; }
a.fact-line:hover span, button.fact-line:hover span { text-decoration: underline; }
.fact-line.muted { color: var(--muted); }
.fact-list { margin: 0; display: grid; gap: 8px; }
.fact-list > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.fact-list dt { font-size: 14px; color: #6a8380; }
.fact-list dd { margin: 0; font-size: 15px; color: #233735; overflow-wrap: anywhere; }
.facts-team { display: grid; gap: 10px; margin-top: 6px; }
.facts-person { display: flex; align-items: center; gap: 10px; }
.facts-person span { display: grid; line-height: 1.25; }
.facts-person b { font-size: 15px; font-weight: 600; }
.facts-person small { font-size: 13px; color: #6a8380; }
.facts-warning { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #94620f; }
.facts-warning svg { width: 17px; height: 17px; }
.facts-foot { display: flex; gap: 18px; padding: 14px 0 16px; border-top: 1px solid #e3ecea; font-size: 14.5px; }

@media (max-width: 1050px) {
  .profile-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .profile-facts { position: static; order: -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
  .facts-group:nth-last-of-type(-n+2) { border-bottom: 0; }
  .facts-foot { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .drawer .modal-head { padding: 18px; }
  .journey, .inactive-banner { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
  .profile-tabs { margin: 0 -18px; padding: 0 10px; }
  .profile-facts { grid-template-columns: minmax(0, 1fr); }
  .facts-group:nth-last-of-type(2) { border-bottom: 1px solid #e3ecea; }
  .head-buttons .btn { flex: 1 1 auto; }
}

/* Cards in the main column: bigger type, calmer borders */
.profile-main .info-grid { gap: 18px; }
.profile-main .info-card { padding: 20px 22px; border-radius: 14px; border-color: #e3ecea; }
.profile-main .info-card header { margin-bottom: 14px; }
.profile-main .info-card header h3 { font-size: 17px; letter-spacing: -.2px; }
.profile-main .info-card header .link { font-size: 14px; }
.profile-main .info-card dt { font-size: 14px; }
.profile-main .info-card dd { font-size: 15px; }
.profile-main .mini-row { padding: 12px 0; gap: 12px; }
.profile-main .mini-row b { font-size: 15px; font-weight: 600; }
.profile-main .mini-row p { font-size: 14px; }
.profile-main .info-card.attention { border-color: #f0e2c4; background: #fffcf6; }
.card-subhead { margin: 16px 0 6px; font-size: 13.5px; font-weight: 650; color: #6a8380; }
.empty-line { font-size: 15px; color: #6f8582; }
.docs-count { font-size: 15px; color: #4e6865; }
.docs-count b { font-family: Manrope, sans-serif; font-size: 22px; color: #17322f; margin-right: 2px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.plain-list svg { width: 17px; height: 17px; color: #c0954a; }
.all-set { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 15px; color: #2f6c53; }
.all-set svg { width: 17px; height: 17px; }
.meter { height: 8px; border-radius: 99px; background: #e6efed; overflow: hidden; margin: 10px 0 4px; }
.meter i { display: block; height: 100%; background: #2fb3a5; border-radius: inherit; }
.attention .meter i { background: #d6a24a; }
.meter.placeholder { background: repeating-linear-gradient(45deg, #eef4f3, #eef4f3 6px, #e3ecea 6px, #e3ecea 12px); }
.meter.placeholder i { width: 0; }

/* At-a-glance strip on the client overview: one bordered row, three sections */
.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; border: 1px solid #e3ecea; border-radius: 14px; background: #fff; }
.glance-item { display: grid; align-content: start; gap: 4px; padding: 18px 22px; min-width: 0; }
.glance-item + .glance-item { border-left: 1px solid #e3ecea; }
.glance-item header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.glance-item h3 { font-family: "DM Sans", sans-serif; font-size: 14px; font-weight: 650; color: #6a8380; }
.glance-item header .link { font-size: 14px; }
.glance-value { font-family: Manrope, sans-serif; font-size: 24px; font-weight: 750; letter-spacing: -.5px; color: #17322f; }
.glance-value.muted { color: #9aaeab; }
.glance-sub { font-size: 14.5px; color: #4e6865; }
.glance-note { font-size: 13px; color: #7f9491; line-height: 1.4; margin-top: 4px; }
.glance-item.attention { background: #fffcf6; }
.glance-item.attention .glance-sub { color: #94620f; font-weight: 600; }
@media (max-width: 800px) {
  .glance { grid-template-columns: minmax(0, 1fr); }
  .glance-item + .glance-item { border-left: 0; border-top: 1px solid #e3ecea; }
}
.drawer:focus { outline: none; }
.head-buttons .btn.icon-only svg { width: 20px; height: 20px; stroke-width: 3; color: #2a4744; }
@media (max-width: 700px) {
  .drawer .modal-head > .icon-btn { position: absolute; top: 14px; right: 52px; margin: 0; }
  .drawer .modal-head > .icon-btn:last-child { right: 12px; }
  .drawer .modal-head .modal-title { padding-right: 70px; }
  .drawer .modal-head .modal-title h2 { font-size: 24px; }
  .journey-track li span { display: none; }
  .profile-facts { order: 0; }
}

/* ---- Care team picker: search a role, add people as chips ---- */
.modal-team { width: min(640px, 94vw); overflow: visible; }
.team-picker + .team-picker { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.team-picker .choice-label { display: block; margin-bottom: 10px; font-family: Manrope, sans-serif; font-size: 16px; font-weight: 700; color: #17322f; }
.team-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.team-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 7px; border: 1px solid #d5e8e4; border-radius: 999px; background: #f2faf8; }
.team-chip .avatar { width: 30px; height: 30px; font-size: 12.5px; }
.team-chip > span:not(.avatar) { display: grid; line-height: 1.2; }
.team-chip b { font-size: 14.5px; font-weight: 600; }
.team-chip small { font-size: 12.5px; color: #6a8380; }
.team-chip-remove { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #5d7976; }
.team-chip-remove:hover { background: #e1efec; color: var(--red); }
.team-chip-remove svg { width: 15px; height: 15px; stroke-width: 2; }
.team-none { padding: 6px 0; }
.team-search { position: relative; }
.team-search > svg { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: #7fa29e; pointer-events: none; }
.team-search input { width: 100%; padding: 11px 14px 11px 40px; border: 1px solid #d5e4e1; border-radius: 10px; font-size: 15px; background: #fff; }
.team-search input:focus { border-color: #149c98; box-shadow: 0 0 0 3px #149c9822; outline: none; }
.team-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: min(340px, 45vh); overflow-y: auto; list-style: none; margin: 0; padding: 4px; border: 1px solid #dbe8e5; border-radius: 12px; background: #fff; box-shadow: 0 10px 28px #0f2a2414; }
.team-option { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.team-option > span:nth-child(2) { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.team-option b { font-size: 15px; font-weight: 600; }
.team-option small { font-size: 13px; color: #6a8380; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-option-add { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: #0b6e69; opacity: 0; }
.team-option-add svg { width: 15px; height: 15px; }
.team-option:hover, .team-option.active { background: #eef8f6; }
.team-option:hover .team-option-add, .team-option.active .team-option-add { opacity: 1; }
.team-empty { padding: 10px; font-size: 14px; color: #6f8582; }
.team-picker [hidden] { display: none !important; }
