:root {
  color-scheme: light;
  --accent: #087e69;
  --accent-hover: #066b5a;
  --accent-soft: #e9f6f3;
  --accent-contrast: #fff;
  --ink: #101c2e;
  --muted: #6d7b91;
  --line: #dfe6ed;
  --surface: #fff;
  --soft: #f4f7f9;
  --sidebar: #202631;
  --danger: #b42318;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.trust-device {
  display: flex !important;
  align-items: center;
  gap: 0.55rem !important;
  font-weight: 600 !important;
}
.trust-device input {
  width: 18px !important;
  height: 18px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  color: var(--ink);
  background: #eef3f5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.loading {
  margin: 20vh auto;
  color: var(--muted);
  text-align: center;
}
.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}
.login-card {
  width: min(100%, 430px);
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(20, 36, 76, 0.1);
}
.login-card h1 {
  margin: 0.75rem 0 0.25rem;
}
.login-card form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
}
.login-card label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 750;
}
.login-card input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.login-card button,
.button {
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  text-decoration: none;
}
.eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.jr-mark {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}
.demo-note {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.3rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--soft);
  font-size: 0.86rem;
}
#loginNotice {
  min-height: 1.2rem;
  color: var(--danger);
}
.dashboard-shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.business-app {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: min(1500px, 100%);
  height: 100%;
  min-height: 0;
  margin: auto;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 70px rgba(18, 38, 50, 0.12);
}
.inbox-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px 14px;
  color: #fff;
  background: linear-gradient(175deg, var(--sidebar), #151a22);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 4px 7px 19px;
}
.side-brand img,
.side-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
}
.side-brand div {
  min-width: 0;
}
.side-brand strong,
.side-brand span {
  display: block;
}
.side-brand strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-brand div span {
  margin-top: 2px;
  color: #d7e3e9;
  font-size: 0.72rem;
}
.side-nav {
  display: grid;
  gap: 7px;
}
.side-nav button,
.side-lower button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  color: #eef8fa;
  background: transparent;
  text-align: left;
}
.side-nav button:hover,
.side-nav button.active {
  background: color-mix(in srgb, var(--accent) 82%, #fff 3%);
}
.side-nav svg,
.side-lower svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--sidebar);
  background: #fff;
  text-align: center;
  font-size: 0.72rem;
}
.side-account {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 15px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.presence-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #39d98a;
  box-shadow: 0 0 0 4px rgba(57, 217, 138, 0.1);
}
.side-account strong,
.side-account span {
  display: block;
}
.side-account strong {
  font-size: 0.84rem;
}
.side-account div > span {
  color: #ccdae0;
  font-size: 0.72rem;
  text-transform: capitalize;
}
.availability-select {
  width: 100%;
  margin-top: 4px;
  padding: 0;
  border: 0;
  color: #d9eceb;
  background: transparent;
  font-size: 0.72rem;
}
.availability-select option {
  color: var(--ink);
}
.side-lower {
  display: grid;
  gap: 2px;
  padding-top: 9px;
}
.side-lower button {
  padding: 9px 10px;
  font-size: 0.78rem;
}
.inbox-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 36%) minmax(0, 1fr);
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.conversation-column {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}
.inbox-title {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.inbox-title h1 {
  margin: 0;
  font-size: 1.35rem;
}
.availability-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: capitalize;
}
.availability-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28bb77;
}
.inbox-tabs {
  display: flex;
  gap: 5px;
  min-height: 49px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.inbox-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
}
.inbox-tabs button.active {
  color: var(--accent);
  font-weight: 800;
}
.inbox-tabs button.active:after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  content: "";
  background: var(--accent);
}
.inbox-tabs b {
  --tab-indicator-color: #e6ebf0;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: #58677a;
  background: var(--tab-indicator-color);
  font-size: 0.65rem;
}
.inbox-tabs .active b {
  --tab-indicator-color: var(--accent);
  color: var(--accent-contrast);
  background: var(--tab-indicator-color);
}
.inbox-tabs button.tab-attention b {
  position: relative;
}
.inbox-tabs button.tab-attention b::before,
.inbox-tabs button.tab-attention b::after {
  position: absolute;
  inset: 0;
  border: 2px solid var(--tab-indicator-color);
  border-radius: inherit;
  content: "";
  pointer-events: none;
  animation: business-new-tab-radiate 1.8s ease-out infinite;
}
.inbox-tabs button.tab-attention b::after { animation-delay: 0.6s; }
@keyframes business-new-tab-radiate {
  0% { opacity: 0.68; transform: scale(0.9); }
  75%, 100% { opacity: 0; transform: scale(2.2); }
}
.conversation-action button:hover,
.primary:hover { background: var(--accent-hover); }
.conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.conversation-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 17px 14px;
  border: 0;
  border-bottom: 1px solid #edf1f4;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.conversation-row:hover,
.conversation-row.selected {
  background: color-mix(in srgb, var(--accent) 7%, #f7fbfd);
}
.request-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border: 2px solid #52718b;
  border-radius: 50%;
}
.request-dot.waiting,
.request-dot.invited {
  border: 0;
  background: #137be8;
}
.request-dot.active {
  background: #fff;
}
.request-dot.closed {
  border-color: #9aa8b5;
}
.conversation-summary,
.conversation-name,
.conversation-subject,
.conversation-detail {
  display: block;
  min-width: 0;
}
.conversation-name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.conversation-name strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-name time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.68rem;
}
.conversation-subject {
  overflow: hidden;
  margin-top: 3px;
  color: #44566e;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-detail {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-arrow {
  color: #29445c;
  font-size: 1.4rem;
}
.list-empty,
.conversation-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  height: 100%;
  padding: 35px;
  color: var(--muted);
  text-align: center;
}
.list-empty strong,
.conversation-empty strong {
  color: var(--ink);
}
.conversation-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.conversation-head {
  display: flex;
  min-height: 123px;
  align-items: flex-start;
  gap: 10px;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--line);
}
.conversation-heading {
  min-width: 0;
  flex: 1;
}
.conversation-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}
.conversation-heading p {
  overflow: hidden;
  margin: 3px 0;
  color: #51627a;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-heading > span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: capitalize;
}
.conversation-heading .state-waiting,
.conversation-heading .state-invited {
  color: #d33b32;
}
.conversation-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.assign-select {
  max-width: 170px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 0.72rem;
}
.more-button,
.mobile-back {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #27435b;
  background: #fff;
}
.more-button svg,
.mobile-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.mobile-back {
  display: none;
}
.menu-wrap {
  position: relative;
}
.conversation-menu {
  position: absolute;
  z-index: 15;
  top: 44px;
  right: 0;
  width: 200px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(17, 37, 55, 0.18);
}
.conversation-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 0.76rem;
}
.conversation-menu button:hover {
  background: var(--soft);
}
.conversation-menu button.danger {
  color: var(--danger);
}
.conversation-menu svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.conversation-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.hosted-chat-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.chat-loading {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
}
.read-only-conversation {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  background: #fff;
}
.read-only-note {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #f8fafb;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
}
.inline-transcript {
  flex: 1;
  min-height: 0;
  padding: 22px clamp(16px, 4vw, 44px) 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.transcript-row {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 16px;
}
.transcript-row.business {
  align-items: flex-end;
}
.transcript-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 5px 4px;
  font-size: 0.68rem;
}
.transcript-meta strong {
  color: var(--ink);
}
.transcript-meta time {
  color: var(--muted);
}
.transcript-bubble {
  width: fit-content;
  max-width: min(78%, 620px);
  padding: 9px 12px;
  border-radius: 10px;
  color: #223247;
  background: #eef1f4;
  overflow-wrap: anywhere;
}
.transcript-row.business .transcript-bubble {
  color: #173d38;
  background: color-mix(in srgb, var(--accent) 13%, #fff);
}
.transcript-bubble p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.82rem;
  line-height: 1.4;
}
.transcript-media-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}
.transcript-media-label + p {
  margin-top: 5px;
}
.transcript-empty {
  display: grid;
  height: 100%;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}
.transcript-empty strong {
  color: var(--ink);
}
.conversation-action {
  display: grid;
  max-width: 390px;
  gap: 15px;
  margin: 16vh auto 0;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafb;
  text-align: center;
}
.conversation-action p {
  margin: 0;
  color: #52647a;
}
.conversation-action button,
.primary {
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--accent-contrast);
  background: var(--accent);
  font-weight: 750;
}
.conversation-action.closed {
  background: #f7f7f7;
}
.conversation-action.manager-observer {
  border-style: dashed;
}
.management-page {
  min-width: 0;
  height: 100vh;
  padding: clamp(22px, 4vw, 52px);
  overflow-y: auto;
  background: #f7f9fa;
}
.section-header {
  margin-bottom: 25px;
}
.section-header h1 {
  margin: 0;
  font-size: 1.7rem;
}
.section-header p {
  margin: 6px 0 0;
  color: var(--muted);
}
.management-grid,
.settings-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.management-grid > *,
.settings-grid > * {
  min-width: 0;
}
.team-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(20, 40, 55, 0.04);
}
.team-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 15px;
}
.team-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  font-weight: 850;
}
.team-copy strong,
.team-copy span,
.team-copy small {
  display: block;
}
.team-copy span {
  margin-top: 3px;
  color: #4d6077;
  font-size: 0.75rem;
  text-transform: capitalize;
}
.team-copy small {
  margin-top: 3px;
  color: var(--muted);
}
.team-actions {
  grid-column: 1/-1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.team-actions select,
.team-actions button,
.settings-card input,
.settings-card select,
.settings-card textarea {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.team-actions button,
.quiet,
.danger-soft {
  border: 0;
  font-size: 0.74rem;
  font-weight: 750;
}
.quiet {
  color: #34536a;
  background: #edf2f5 !important;
}
.danger-soft {
  color: var(--danger);
  background: #fff0ef !important;
}
.settings-card {
  padding: 20px;
}
.settings-card h2 {
  margin: 0;
  font-size: 1rem;
}
.settings-card > p {
  color: var(--muted);
  font-size: 0.8rem;
}
.add-staff {
  margin-top: 14px;
}
.add-staff form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 8px;
  margin-top: 15px;
}
.settings-details,
.customer-details {
  display: grid;
  grid-template-columns: minmax(100px, 0.4fr) 1fr;
  gap: 10px;
  margin: 18px 0 0;
}
.settings-details dt,
.customer-details dt {
  color: var(--muted);
  font-size: 0.75rem;
}
.settings-details dd,
.customer-details dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
}
.hours-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.hours-form label {
  display: grid;
  gap: 5px;
  color: #42556c;
  font-size: 0.75rem;
  font-weight: 700;
}
.day-row {
  display: grid;
  grid-template-columns: 42px auto 1fr 1fr;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
}
.model-list {
  margin: 15px 0 0;
  padding-left: 18px;
  color: #3e5368;
  font-size: 0.82rem;
}
.model-list li + li {
  margin-top: 8px;
}
.demo-tools {
  margin-top: 14px;
}
.demo-tools > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.button-link {
  padding: 9px 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
  text-decoration: none;
}
.notice {
  position: fixed;
  z-index: 50;
  right: 1rem;
  bottom: 1rem;
  max-width: min(390px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border-radius: 9px;
  color: #fff;
  background: #173347;
  box-shadow: 0 10px 32px rgba(9, 20, 49, 0.25);
  font-size: 0.82rem;
}
.notice.error {
  background: var(--danger);
}
.business-dialog {
  width: min(680px, calc(100vw - 2rem));
  max-height: 80dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  box-shadow: 0 20px 70px rgba(14, 25, 56, 0.25);
}
.business-dialog[open] {
  display: flex;
  flex-direction: column;
}
.business-dialog::backdrop {
  background: rgba(8, 17, 41, 0.35);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.dialog-head h2 {
  margin: 0;
  font-size: 1rem;
}
.dialog-head button {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
}
.dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.history-messages {
  display: grid;
  gap: 9px;
}
.history-message {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
}
.history-message strong,
.history-message time {
  font-size: 0.68rem;
}
.history-message time {
  margin-left: 7px;
  color: var(--muted);
}
.history-message p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  font-size: 0.8rem;
}
.lab-page {
  padding: clamp(1rem, 4vw, 3rem);
  background: radial-gradient(circle at top, #edf2ff, #f8f9fc 45%);
}
.lab-shell {
  width: min(1120px, 100%);
  margin: auto;
}
.lab-shell > header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.lab-shell h1 {
  margin: 0;
}
.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.lab-grid article {
  display: grid;
  min-height: 225px;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.lab-grid article > p:not(.eyebrow) {
  color: var(--muted);
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
}
.operator-link {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.lab-foot {
  color: var(--muted);
  text-align: center;
}
@media (max-width: 920px) {
  .business-app {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .side-brand div,
  .side-nav button > span,
  .side-lower button > span,
  .side-account div {
    display: none;
  }
  .side-brand {
    justify-content: center;
    padding-inline: 0;
  }
  .side-nav button,
  .side-lower button {
    justify-content: center;
  }
  .nav-count {
    position: absolute;
    margin: -27px 0 0 27px;
  }
  .side-account {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .management-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .add-staff form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lab-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  .business-app {
    display: block;
  }
  .inbox-sidebar {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    height: 58px;
    padding: 5px max(8px, env(safe-area-inset-right))
      calc(5px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .side-brand,
  .side-account,
  .side-lower {
    display: none;
  }
  .side-nav {
    display: flex;
    justify-content: space-around;
  }
  .side-nav button {
    width: auto;
    min-width: 66px;
    flex-direction: column;
    gap: 1px;
    padding: 4px 10px;
    font-size: 0.62rem;
  }
  .side-nav button > span {
    display: block;
  }
  .side-nav svg {
    width: 18px;
    height: 18px;
  }
  .nav-count {
    margin: -24px 0 0 24px;
  }
  .inbox-workspace,
  .management-page {
    height: calc(100dvh - 58px);
  }
  .inbox-workspace {
    display: block;
  }
  .conversation-column,
  .conversation-pane {
    height: 100%;
  }
  .inbox-workspace.has-selection .conversation-column {
    display: none;
  }
  .inbox-workspace:not(.has-selection) .conversation-pane {
    display: none;
  }
  .mobile-back {
    display: grid;
    flex: 0 0 36px;
  }
  .conversation-head {
    min-height: 104px;
    padding: 15px 12px;
  }
  .conversation-head-actions {
    gap: 5px;
  }
  .assign-select {
    max-width: 120px;
  }
  .conversation-menu {
    right: 0;
  }
  .inline-transcript {
    padding: 16px 13px 24px;
  }
  .transcript-bubble {
    max-width: 86%;
  }
  .management-page {
    padding: 20px 14px 80px;
  }
  .add-staff form {
    grid-template-columns: 1fr;
  }
  .team-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .lab-shell > header {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 370px) {
  .conversation-head {
    flex-wrap: wrap;
  }
  .conversation-heading {
    width: calc(100% - 50px);
  }
  .conversation-head-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .assign-select {
    max-width: calc(100% - 45px);
    flex: 1;
  }
}

.branding-form {
  display: grid;
  min-width: 0;
  gap: 14px;
}
.branding-form > label,
.brand-color-row label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
}
.background-slider input[type="range"] {
  height: 28px;
  padding: 0;
  border: 0;
  outline-offset: 4px;
  accent-color: var(--accent);
  background: transparent;
}
.background-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 9px;
  border: 1px solid #cbd1d8;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #f1f3f6 34%, #d8dde3 67%, #747c87);
}
.background-slider input[type="range"]::-moz-range-track {
  height: 9px;
  border: 1px solid #cbd1d8;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff, #f1f3f6 34%, #d8dde3 67%, #747c87);
}
.background-slider-scale {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
}
.background-slider-scale > :last-child { text-align: right; }
.background-slider-value {
  min-width: 92px;
  color: var(--ink);
  text-align: center;
}
.brand-color-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.38fr) 1fr;
  gap: 12px;
}
.brand-color-row input[type="color"] {
  min-height: 45px;
  padding: 4px;
}
.branding-form input,
.branding-form select {
  width: 100%;
  max-width: 100%;
}
.branding-preview {
  --preview-accent: var(--accent);
  --preview-contrast: var(--accent-contrast);
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.branding-preview > header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.branding-preview > header img,
.preview-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
}
.preview-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--preview-accent);
}
.preview-chat {
  position: relative;
  display: flex;
  min-height: 145px;
  padding: 22px 14px;
  flex-direction: column;
  gap: 12px;
  color: var(--preview-foreground, #101744);
  background: var(--preview-background, #fff);
}
.preview-chat p {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: 78%;
  margin: 0;
  padding: 8px 11px;
  border-radius: 11px;
  font-size: 0.78rem;
}
.preview-received { background: var(--preview-incoming, #f3f4f7); }
.preview-sent { align-self: flex-end; background: var(--preview-outgoing, #e3edff); }
.preview-watermark {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 58%;
  max-height: 115px;
  object-fit: contain;
  opacity: var(--preview-watermark-opacity, 0.055);
  transform: translate(-50%, -50%);
}
.preview-send {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--preview-contrast);
  background: var(--preview-accent);
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.palette-heading {
  margin: 5px 0 -2px;
  font-size: 0.92rem;
}
.palette-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #f8fafb;
  font-size: 0.72rem;
}
.palette-status strong { color: var(--ink); }
.bubble-palette-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.bubble-palette-option {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.bubble-palette-option:hover,
.bubble-palette-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.bubble-palette-option strong { overflow: hidden; font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.bubble-palette-option small { min-height: 1em; color: var(--muted); font-size: 0.58rem; }
.palette-bubbles { display: grid; gap: 3px; min-height: 30px; padding: 4px; border-radius: 7px; background: #f8fafc; }
.palette-bubbles i { display: block; width: 70%; height: 8px; border: 1px solid rgba(16, 28, 46, 0.08); border-radius: 999px; }
.palette-bubbles i:last-child { justify-self: end; }
.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  margin: 10px 0;
  font-weight: 700;
}
.check-row input { width: 18px !important; height: 18px; }
.device-list { display: grid; gap: 8px; margin: 12px 0; }
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.device-row > div { display: grid; gap: 3px; }
.device-row small { color: var(--muted); }
.switch-form { display: grid; gap: 12px; }
.lock-card .text-link { display: block; margin-top: 16px; text-align: center; color: var(--accent); }

@media (max-width: 900px) {
  .bubble-palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .brand-color-row { grid-template-columns: 92px 1fr; }
  .settings-actions > button { width: 100%; }
  .device-row { align-items: flex-start; }
}

/* Stage 8 Business operator workspace */
.business-app { grid-template-columns: 196px minmax(0, 1fr); width: min(1600px, 100%); }
.inbox-sidebar { background: linear-gradient(180deg, #25313d, #171e27); }
.side-nav button.active { background: color-mix(in srgb, var(--accent) 76%, #263542); }
.inbox-workspace { grid-template-columns: clamp(300px, 32vw, 390px) minmax(0, 1fr); }
.inbox-title { min-height: 66px; }
.inbox-tabs { overflow-x: auto; scrollbar-width: none; }
.inbox-tabs::-webkit-scrollbar { display: none; }
.inbox-tabs button { flex: 1 0 auto; min-width: 58px; }
.conversation-row { min-height: 104px; padding: 14px; }
.conversation-row.unread { background: color-mix(in srgb, var(--accent) 5%, #fff); }
.conversation-row.unread .conversation-name strong { font-weight: 850; }
.conversation-row.attention .request-dot {
  border: 0;
  background: #137be8;
}
.conversation-row.attention .request-dot::before,
.conversation-row.attention .request-dot::after {
  position: absolute;
  inset: -1px;
  border: 2px solid #137be8;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  animation: business-unread-radiate 1.8s ease-out infinite;
}
.conversation-row.attention .request-dot::after { animation-delay: 0.6s; }
@keyframes business-unread-radiate {
  0% { opacity: 0.72; transform: scale(0.8); }
  75%, 100% { opacity: 0; transform: scale(3.4); }
}
.unread-label { padding: 2px 7px; border-radius: 999px; color: #9f1f19; background: #ffe5e2; font-size: 0.62rem; }
.conversation-preview { display: block; overflow: hidden; margin-top: 4px; color: #718092; font-size: 0.69rem; text-overflow: ellipsis; white-space: nowrap; }
.conversation-head { min-height: 94px; align-items: center; padding: 16px 20px; }
.conversation-heading > span { display: inline-block; margin-top: 2px; }
.conversation-body { position: relative; }
.management-page { padding: clamp(24px, 3vw, 42px); }
.section-header { margin-bottom: 20px; }
.section-header h1 { font-size: clamp(1.45rem, 2.2vw, 1.9rem); }
.settings-page,.analytics-page,.help-page { background: #f5f7f9; }
.settings-nav { display: flex; gap: 6px; margin: -4px 0 18px; padding: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; scrollbar-width: none; }
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav button { flex: 0 0 auto; padding: 9px 12px; border: 0; border-radius: 8px; color: #4b5e70; background: transparent; font-size: 0.76rem; font-weight: 750; }
.settings-nav button.active { color: var(--accent); background: var(--accent-soft); }
.settings-stage { display: grid; grid-template-columns: minmax(0, 760px); gap: 14px; align-items: start; }
.settings-stage .branding-card { grid-column: auto; }
.settings-explainer { display: block; margin-top: 16px; color: var(--muted); line-height: 1.45; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { display: grid; gap: 7px; min-height: 132px; align-content: center; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 22px rgba(20, 40, 55, 0.04); }
.metric-card span,.metric-card small { color: var(--muted); }
.metric-card span { font-size: 0.75rem; font-weight: 750; }
.metric-card strong { color: var(--ink); font-size: 2rem; }
.metric-card small { font-size: 0.68rem; }
.analytics-note { margin: -8px 0 18px; color: var(--muted); font-size: 0.76rem; }
.analytics-periods { display: inline-flex; gap: 5px; margin: -6px 0 22px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.analytics-periods button { padding: 8px 12px; border: 0; border-radius: 8px; color: #526578; background: transparent; font: inherit; font-size: 0.75rem; font-weight: 800; cursor: pointer; }
.analytics-periods button.active { color: var(--accent); background: var(--accent-soft); }
.analytics-summary { max-width: 620px; margin-top: 14px; }
.analytics-bars { display: grid; gap: 8px; }
.analytics-bars div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.analytics-bars strong { text-align: right; }
.billing-summary { display: grid; gap: 12px; }
.billing-plan-label { display: grid; gap: 7px; font-weight: 800; }
.billing-plan-select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.billing-attention { margin: 0; padding: 10px 12px; border-radius: 9px; background: #fff5db; color: #694a00; font-weight: 750; }
.billing-change-preview { display: grid; gap: 9px; padding: 14px; border: 1px solid #bfd5df; border-radius: 11px; background: #f5fafc; }
.billing-change-preview h3, .billing-change-preview p { margin: 0; }
.billing-change-preview .settings-kicker { color: #315e72; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.help-grid .settings-card { min-width: 0; }
.help-grid ol { margin: 14px 0 0; padding-left: 20px; color: #42566c; font-size: 0.8rem; line-height: 1.65; }
.support-extension { grid-column: 1 / -1; max-width: 760px; }

@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox-workspace { grid-template-columns: minmax(275px, 36%) minmax(0, 1fr); }
}

@media (max-width: 920px) {
  .business-app { grid-template-columns: 76px minmax(0, 1fr); }
  .help-grid { grid-template-columns: 1fr; }
  .support-extension { grid-column: auto; }
}

@media (max-width: 680px) {
  .inbox-sidebar { height: calc(62px + env(safe-area-inset-bottom)); background: #202a35; }
  .side-nav { gap: 0; }
  .side-nav button { min-width: 0; flex: 1 1 20%; padding: 4px 2px; }
  .side-nav button > span { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-count { margin: -23px 0 0 22px; }
  .inbox-workspace,.management-page { height: calc(100dvh - 62px - env(safe-area-inset-bottom)); }
  .inbox-title { min-height: 60px; padding-inline: 16px; }
  .conversation-head { min-height: 88px; padding: 12px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 112px; padding: 14px; }
  .settings-nav { margin-inline: -2px; }
}

@media (max-width: 370px) {
  .side-nav button { font-size: 0.56rem; }
  .side-nav svg { width: 17px; height: 17px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 102px; padding: 11px; }
  .metric-card strong { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .inbox-tabs button.tab-attention b::before,
  .inbox-tabs button.tab-attention b::after,
  .conversation-row.attention .request-dot::before,
  .conversation-row.attention .request-dot::after { animation: none; opacity: 0; }
}
.getting-started { display:flex; align-items:center; justify-content:space-between; gap:22px; margin:20px 24px 0; padding:18px 20px; border:1px solid color-mix(in srgb,var(--accent) 28%,#dbe4ef); border-radius:16px; background:color-mix(in srgb,var(--accent-soft) 72%,#fff); box-shadow:0 8px 24px rgba(24,48,82,.08); }
.getting-started h2 { margin:2px 0 5px; font-size:1.18rem; }
.getting-started p { margin-bottom:0; }
.getting-started-signin { color:#334a61; font-size:.78rem; }
.getting-started-signin strong { color:var(--ink); }
.getting-started-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.new-business-entry { display:grid; gap:7px; margin-top:22px; padding-top:20px; border-top:1px solid #dce4ee; text-align:left; }
.new-business-entry span { color:#66758c; font-size:.92rem; }
.new-business-entry .button-link { display:inline-flex; justify-content:center; margin-top:4px; }
@media (max-width:680px) { .getting-started { align-items:flex-start; flex-direction:column; margin:12px 12px 0; } .getting-started-actions { width:100%; justify-content:flex-start; } }
