:root {
  --canvas: #f3f6f6;
  --surface: #ffffff;
  --ink: #203330;
  --muted: #60706d;
  --line: #dce5e2;
  --teal: #14665c;
  --teal-wash: #edf6f3;
  --green: #22754b;
  --red: #b53e42;
  --red-wash: #fff1f1;
  --focus: #118276;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, a, input, textarea, audio { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, input, textarea { border-radius: 9px; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, audio:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, textarea { width: 100%; min-width: 0; min-height: 48px; background: var(--surface); color: var(--ink); border: 1px solid #aebfba; padding: 11px 13px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:disabled, textarea:disabled { background: #f2f5f4; color: var(--muted); }
textarea { resize: vertical; line-height: 1.6; max-height: 300px; }
label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 8px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.3; }
h3 { font-size: 1.07rem; font-weight: 600; }
h4 { font-size: .9rem; font-weight: 600; }
[hidden] { display: none !important; }
.subtle, .small-label { color: var(--muted); }
.subtle { font-size: .87rem; }
.small-label { font-size: .8rem; }
.eyebrow { color: var(--teal); font-weight: 600; font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 12px #20333004; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; padding: 10px 16px; font-weight: 600; font-size: .87rem; line-height: 1.3; }
.button { transition: background-color 120ms, border-color 120ms; }
.primary { color: #fff; background: var(--teal); }
.primary:hover:not(:disabled) { background: #0e5149; }
.secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.secondary:hover:not(:disabled), .icon-button:hover:not(:disabled), .quiet:hover:not(:disabled) { background: var(--teal-wash); border-color: #b4cec4; }
.quiet { background: transparent; color: var(--muted); }
.icon-button { min-width: 44px; padding: 8px; background: transparent; border: 1px solid var(--line); font-size: 1.2rem; }
.call-button { color: #fff; background: var(--green); }
.call-button:hover:not(:disabled) { background: #1a603d; }
.danger { color: #fff; background: var(--red); }
.danger:hover:not(:disabled) { background: #9c3036; }
.skip-link { position: fixed; top: 8px; left: 16px; transform: translateY(-150%); z-index: 10; padding: 12px; background: white; color: var(--teal); }
.skip-link:focus { transform: translateY(0); }
.topbar { min-height: 80px; padding: 14px max(24px, calc((100vw - 1440px) / 2)); display: flex; align-items: center; gap: 28px; flex-wrap: nowrap; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--teal); color: #fff; font-size: 1.6rem; font-weight: 600; letter-spacing: -.06em; }
.brand h1 { font-size: 1.13rem; font-weight: 600; letter-spacing: -.03em; }
.connection { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; white-space: nowrap; padding: 9px 12px; min-height: 44px; font-size: .8rem; font-weight: 500; border: 1px solid var(--line); border-radius: 100px; background: #f8faf9; color: var(--muted); }
#connection-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.connection[data-state="ready"] { background: var(--teal-wash); color: var(--teal); border-color: #d5e9df; }
.connection[data-state="offline"], .connection[data-state="blocked"] { color: var(--red); background: var(--red-wash); }
.account { margin-left: auto; display: flex; gap: 20px; align-items: center; min-width: 0; }
.account .button { flex-shrink: 0; white-space: nowrap; }
.user-name { min-width: 0; max-width: 220px; font-size: .87rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace { max-width: 1440px; margin: 0 auto; padding: 16px 24px 24px; }
.section-label { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-label h3 { font-size: .87rem; }
.locations { min-width: 0; position: sticky; top: 16px; }
.spa-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 16px; }
.spa-summary h3 { font-size: .93rem; }
.spa-picker { display: none; }
.spa-search { margin-bottom: 12px; }
.spa-search label { font-size: .8rem; }
#spa-search-empty { padding: 16px 4px; }
.spa-picker strong, #spa-picker-number { display: block; overflow-wrap: anywhere; }
.picker-chevron { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); flex-shrink: 0; margin: 0 5px; }
.spa-picker[aria-expanded="true"] .picker-chevron { transform: rotate(225deg); }
.spa-options { min-width: 0; }
.line-switcher { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-height: max(280px, calc(100dvh - 290px)); overflow-y: auto; padding: 4px; margin: -4px; scrollbar-color: #aebfba var(--canvas); }
.line-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 92px; padding: 13px 14px; background: white; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.line-card:hover:not(:disabled) { border-color: #8eb1a6; }
.line-card[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-wash); box-shadow: inset 0 0 0 1px var(--teal); }
.line-card:disabled { opacity: 1; }
.line-selector { width: 19px; height: 19px; border: 1.5px solid #91a49d; border-radius: 50%; }
.line-card[aria-pressed="true"] .line-selector { border: 5px solid var(--teal); background: white; }
.line-name { display: block; font-weight: 600; font-size: .87rem; overflow-wrap: anywhere; }
.line-details { display: flex; flex-direction: column; overflow-wrap: anywhere; gap: 2px; margin-top: 5px; font-size: .82rem; color: var(--muted); }
.line-number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-grid; place-items: center; min-width: 25px; height: 25px; padding: 0 6px; font-size: .75rem; font-weight: 600; border-radius: 100px; color: white; background: var(--teal); }
.workspace-grid { display: grid; grid-template-columns: 220px minmax(280px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.dialer { padding: 20px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.phone-input-wrap { position: relative; }
#phone-number { min-height: 64px; padding-right: 55px; font-size: 1.3rem; font-weight: 500; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.phone-input-wrap .icon-button { position: absolute; right: 7px; top: 10px; border: 0; color: var(--muted); }
.dialpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 20px 0; }
.dial-key { height: 63px; background: #fafcfb; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--ink); }
.dial-key:hover { background: var(--teal-wash); border-color: #9dbdb1; }
.dial-key:active { background: #dcece5; }
.key-digit { font-size: 1.4rem; line-height: 1.2; }
.key-letters { font-size: .6rem; min-height: 12px; letter-spacing: .15em; margin-top: 2px; color: var(--muted); }
.calling-from { min-height: 48px; font-size: .8rem; font-weight: 500; color: var(--teal); margin-bottom: 10px; overflow-wrap: anywhere; }
.call-actions { display: flex; gap: 9px; }
.call-actions > button { min-height: 50px; font-size: 1rem; }
#call, #hangup { flex: 1; }
#mute[aria-pressed="true"] { color: var(--teal); background: var(--teal-wash); border-color: var(--teal); }
.call-state { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; text-align: center; font-size: .87rem; padding: 16px 0; min-height: 54px; color: var(--muted); }
.call-state:has([data-tone="error"]) { color: var(--red); }
.call-state:has([data-tone="live"]) { color: var(--green); }
#call-timer { font-variant-numeric: tabular-nums; }
.dialer-hint { border-top: 1px solid var(--line); padding-top: 16px; font-size: .8rem; color: var(--muted); line-height: 1.7; }
.activity { min-width: 0; overflow: hidden; }
.activity-heading { padding: 22px 24px 0; margin-bottom: 19px; }
.activity-heading p { margin-top: 4px; }
.tabs { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.tabs button { display: flex; align-items: center; gap: 8px; min-height: 47px; padding: 9px 4px 14px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-weight: 500; }
.tabs button[aria-selected="true"] { color: var(--teal); border-bottom-color: var(--teal); }
.tab-count { font-size: .7rem; background: var(--teal-wash); border-radius: 5px; padding: 1px 5px; }
.list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; }
.calls-list, .leads-list { max-height: 620px; overflow-y: auto; }
.lead-row { padding: 18px 24px; border-top: 1px solid #e9eeec; overflow-wrap: anywhere; }
.lead-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lead-heading > div { min-width: 0; }
.lead-name { font-weight: 600; font-size: 1rem; }
.lead-phone { display: block; color: var(--muted); font-size: .87rem; font-variant-numeric: tabular-nums; margin-top: 2px; }
.lead-service { margin-top: 12px; font-size: .9rem; font-weight: 500; }
.lead-appointment { margin-top: 3px; font-size: .83rem; }
.lead-booked { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.lead-status { flex-shrink: 0; border-radius: 6px; padding: 3px 8px; background: #f0f3f2; color: #52635e; font-size: .75rem; font-weight: 600; }
.lead-status[data-status="new"] { background: var(--teal-wash); color: var(--teal); }
.lead-status[data-status="called"], .lead-status[data-status="texted"] { background: #eef3f7; color: #39576b; }
.lead-row .row-actions a { text-decoration: none; border-radius: 9px; }
.lead-row .row-actions { gap: 6px; }
.lead-row .row-actions .button { padding-inline: 10px; }
.lead-status-error { margin-top: 8px; }
::selection { background: #d4e9e2; color: var(--ink); }
input, textarea { caret-color: var(--teal); }
.call-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 18px 24px; border-top: 1px solid #e9eeec; }
.direction-icon { display: grid; place-items: center; width: 32px; height: 32px; background: #f0f5f3; color: var(--teal); border-radius: 50%; font-size: 1.1rem; }
.call-row.attention .direction-icon { background: var(--red-wash); color: var(--red); }
.call-row-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.remote-number { font-weight: 600; font-size: .97rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.outcome { color: var(--muted); font-size: .78rem; }
.attention .outcome { color: var(--red); }
.call-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: .78rem; color: var(--muted); margin-top: 5px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row-actions .button { font-size: .8rem; padding: 8px 12px; min-height: 44px; }
.voicemail { margin-top: 12px; }
.voicemail audio { display: block; width: 100%; height: 44px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 48px 24px; color: var(--muted); min-height: 210px; font-size: .87rem; }
.empty-state strong { color: var(--ink); font-size: 1rem; font-weight: 500; }
.threads-list { max-height: 540px; overflow-y: auto; }
.thread-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; width: 100%; padding: 18px 24px; text-align: left; border: 0; border-top: 1px solid #e9eeec; border-radius: 0; background: white; }
.thread-row:hover { background: #f7faf8; }
.thread-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .87rem; }
.thread-time { color: var(--muted); font-size: .73rem; align-self: center; }
.unseen-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); justify-self: end; align-self: center; }
.new-text-form { padding: 20px 24px; border-top: 1px solid var(--line); }
.new-text-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.new-text-fields input { flex: 1 1 180px; }
.thread-heading { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.thread-heading > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.thread-heading h4 { font-variant-numeric: tabular-nums; }
.thread-heading p { font-size: .75rem; margin-top: 3px; }
.messages-list { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px; min-height: 240px; height: 340px; overflow: auto; background: #fcfdfc; }
.message { max-width: 88%; align-self: flex-start; min-width: 90px; }
.message.outbound { align-self: flex-end; }
.message-body { padding: 12px 15px; background: #eef2f0; border: 1px solid #e5ebe8; border-radius: 12px 12px 12px 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.outbound .message-body { background: var(--teal-wash); border-color: #d5e7df; border-radius: 12px 12px 3px 12px; }
.message-meta { margin-top: 6px; font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.outbound .message-meta { text-align: right; }
.message-error { color: var(--red); font-size: .78rem; margin-top: 5px; overflow-wrap: anywhere; }
.message-media { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.message-media img, .message-media video { display: block; max-width: 100%; max-height: 250px; border-radius: 6px; object-fit: contain; }
.message-media audio { width: 100%; max-width: 280px; height: 44px; }
.attachment { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal); font-size: .83rem; }
.composer { padding: 18px 24px 22px; border-top: 1px solid var(--line); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
#composer-hint { font-size: .7rem; margin-top: 3px; }
.form-error { color: var(--red); font-size: .85rem; overflow-wrap: anywhere; }
.form-error:not(:empty) { margin-top: 10px; }
.activity-error { margin: 0 !important; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--red-wash); }
.notice { padding: 13px 15px; background: #f1f6f3; border: 1px solid #d5e3da; color: #435f51; border-radius: 8px; font-size: .8rem; line-height: 1.65; margin-bottom: 16px; }
.error-notice { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--red-wash); border-color: #ecc9ca; color: var(--red); }
.incoming { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 24px; margin-bottom: 24px; border: 2px solid var(--teal); background: var(--teal-wash); }
.incoming h2 { font-size: 1.15rem; margin-top: 7px; overflow-wrap: anywhere; }
.incoming-number { font-size: 1.1rem; margin-top: 5px; font-variant-numeric: tabular-nums; }
.incoming-actions { display: flex; gap: 10px; }
.incoming-actions button { min-width: 100px; min-height: 48px; }
.workspace-footer { font-size: .75rem; color: var(--muted); text-align: center; margin-top: 22px; }
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 416px; padding: 36px; }
.login-card > .brand-mark { margin-bottom: 26px; width: 45px; height: 45px; }
.login-card h1 { font-size: 1.85rem; font-weight: 500; letter-spacing: -.045em; margin-top: 8px; }
.login-intro { margin: 10px 0 28px; }
.login-card input { margin-bottom: 18px; }
.login-card .form-error { min-height: 24px; margin: 0 0 12px; }
.login-submit { width: 100%; min-height: 48px; }
.login-footer { color: var(--muted); font-size: .75rem; text-align: center; margin-top: 28px; }
@media (max-width: 1023px) {
  .workspace { max-width: 760px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .locations { position: static; }
  .spa-summary { padding-bottom: 10px; }
  .spa-picker { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 76px; text-align: left; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); }
  .spa-picker > span:first-child { min-width: 0; }
  .spa-picker strong { font-size: .93rem; margin: 2px 0; }
  #spa-picker-number { font-size: .8rem; color: var(--muted); }
  .spa-options { display: none; padding-top: 16px; }
  .spa-options[data-open="true"] { display: block; }
  .line-switcher { max-height: 350px; }
  .dialer { padding: 24px max(24px, calc((100% - 410px) / 2)); }
  .topbar { padding-inline: 24px; gap: 18px; }
  .account { gap: 8px; }
  .line-card { padding: 16px; gap: 9px; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; gap: 10px 12px; }
  .connection { font-size: .73rem; padding-inline: 9px; max-width: 190px; }
  .workspace { padding: 16px 16px 20px; }
  .section-label > span { font-size: .75rem; }
  .line-switcher { grid-template-columns: 1fr; gap: 10px; }
  .line-card { min-height: 88px; }
  .workspace-grid { gap: 18px; }
  .dialer { padding: 20px; }
  .panel-heading { margin-bottom: 20px; }
  .activity-heading, .list-heading { padding-left: 18px; padding-right: 18px; }
  .tabs { padding-inline: 18px; gap: 18px; }
  .lead-row { padding: 16px; }
  .call-row { padding: 16px; grid-template-columns: 28px minmax(0, 1fr); }
  .direction-icon { width: 28px; height: 28px; }
  .call-row-heading { align-items: start; }
  .thread-row { padding: 16px; }
  .thread-row .remote-number { font-size: .9rem; }
  .thread-heading { padding: 14px 12px; gap: 8px; flex-wrap: wrap; }
  .thread-heading .button { padding-inline: 10px; font-size: .75rem; }
  .messages-list { padding: 20px 14px; }
  .message { max-width: 92%; }
  .composer, .new-text-form { padding: 16px; }
  #composer-hint { max-width: 145px; }
  .incoming { flex-direction: column; align-items: stretch; padding: 18px; gap: 16px; }
  .incoming-actions > button { flex: 1; }
  .login-card { padding: 28px 24px; }
}
@media (width < 480px) {
  .topbar { gap: 8px; }
  .user-name { display: none; }
  .account { flex-shrink: 0; }
  .account .button { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
