:root {
  --ink: #09244d;
  --ink-soft: #37506f;
  --paper: #f6f7f9;
  --panel: #ffffff;
  --line: #d9dee7;
  --teal: #0c8f8b;
  --teal-dark: #066c69;
  --gold: #b9862d;
  --rose: #b65a62;
  --green: #4f7d4b;
  --shadow: 0 18px 50px rgba(18, 33, 56, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

body.splash-lock {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 36%, rgba(214, 180, 112, 0.22), transparent 38%),
    linear-gradient(180deg, #faf7f2 0%, #f5f1e8 100%);
  transition: opacity 700ms ease, visibility 700ms ease;
}

.splash-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  display: grid;
  justify-items: center;
  max-width: 760px;
  text-align: center;
  animation: splashRise 900ms ease both;
}

.splash-logo {
  width: min(190px, 44vw);
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 22px 30px rgba(92, 62, 24, 0.22));
}

.splash-eyebrow {
  margin-bottom: 10px;
  color: #8a6426;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.splash-content h1 {
  max-width: 720px;
  font-size: clamp(2.1rem, 6vw, 4.5rem);
  line-height: 1.02;
}

.splash-tagline {
  max-width: 620px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.5;
}

.splash-support {
  margin-top: 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

@keyframes splashRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  overflow: hidden;
}

.mobile-menu-button,
.mobile-menu-close,
.mobile-menu-backdrop,
.mobile-bottom-nav {
  display: none;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  background: #fff;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.brand-lockup,
.chat-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-logo.small {
  width: 38px;
  height: 38px;
}

.powered-lockup {
  display: none;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.powered-lockup .brand-logo {
  width: 20px;
  height: 20px;
}

.chat-powered {
  margin-top: 5px;
  text-transform: none;
  letter-spacing: 0;
}

.chat-powered .brand-logo.small {
  width: 18px;
  height: 18px;
}

.business-logo {
  display: none;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  color: #fff;
  background: #0f766e;
  border-radius: 8px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.business-logo.small {
  width: 42px;
  height: 42px;
  font-size: 0.95rem;
}

body.business-brand-mode .business-logo {
  display: grid;
}

body.business-brand-mode .brand-logo {
  width: 20px;
  height: 20px;
}

body.business-brand-mode .brand-logo.small {
  width: 18px;
  height: 18px;
}

body.business-brand-mode .brand-lockup h1,
body.business-brand-mode .chat-identity h3 {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.05;
}

body.business-brand-mode .brand-subtitle,
body.business-brand-mode .chat-powered + p {
  color: var(--ink-soft);
}

body.business-brand-mode .powered-lockup {
  display: flex;
}

body.business-brand-mode #chat-subtitle:empty {
  display: none;
}

body.business-brand-mode .brand-subtitle:empty {
  display: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.45rem;
  line-height: 1.1;
}

.brand-lockup p,
.chat-header p,
.profile-card dd,
.eyebrow {
  color: #7c8798;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: #eef2f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-button,
.nav-item,
.chip,
.secondary-button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
}

.mode-button {
  min-height: 38px;
  border-radius: 6px;
  font-weight: 700;
}

.mode-button.active {
  color: #fff;
  background: var(--ink);
}

.workflow-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px;
  text-align: left;
  border-radius: 8px;
}

.nav-item span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: var(--ink-soft);
  border-radius: 50%;
  font-weight: 800;
}

.nav-item.active {
  color: var(--ink);
  background: #eef7f7;
}

.nav-item.active span {
  background: var(--teal);
}

.profile-card,
.location-card,
.auth-card,
.starter-panel,
.chat-panel,
.panel-wide,
.insight-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-card {
  padding: 18px;
}

.profile-card h2,
.location-card h2,
.auth-card h2 {
  margin-bottom: 16px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.location-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.location-card p {
  color: var(--ink-soft);
  line-height: 1.35;
}

.location-card label {
  font-size: 0.9rem;
}

.location-card input[type="text"] {
  min-height: 44px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 auto;
}

.location-actions {
  display: grid;
  gap: 8px;
}

.location-actions .secondary-button {
  width: 100%;
}

.auth-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.auth-card p {
  color: var(--ink-soft);
  line-height: 1.35;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  font-size: 0.9rem;
}

.auth-card .secondary-button,
.auth-card .primary-button {
  width: 100%;
}

dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

dt {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 32px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1180px;
  margin: 0 auto 22px;
  text-align: center;
}

.eyebrow {
  margin-bottom: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.secondary-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

.view {
  display: none;
  width: 100%;
  max-width: 1180px;
  min-height: 0;
  margin: 0 auto;
}

.view.active {
  display: block;
  height: 100%;
}

.intake-layout,
.matches-grid,
.care-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 22px;
  min-height: 0;
  height: 100%;
}

.intake-layout.chat-first {
  grid-template-columns: minmax(320px, 880px);
  justify-content: center;
}

.intake-layout.guided-open {
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 420px);
}

.intake-layout.guided-open .chat-panel {
  order: 1;
}

.intake-layout.guided-open .starter-panel {
  order: 2;
}

.intake-layout.guided-open .chat-header {
  grid-template-columns: 1fr auto;
}

.intake-layout.guided-open .chat-mode-switch {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
}

.intake-layout.guided-open .chat-reset {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.starter-panel,
.chat-panel,
.panel-wide,
.insight-panel {
  box-shadow: var(--shadow);
}

.starter-panel {
  display: grid;
  gap: 18px;
  align-self: start;
  max-height: 100%;
  padding: 24px;
  overflow: auto;
}

.starter-panel.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.starter-panel h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

select,
input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: #00183a;
  background: #fff;
  border: 1px solid #cbd3df;
  border-radius: 8px;
}

select:focus,
input:focus {
  border-color: var(--teal);
  outline: 2px solid rgba(12, 143, 139, 0.16);
}

.primary-button {
  min-height: 48px;
  padding: 0 18px;
  color: #fff;
  background: var(--teal);
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.chat-header {
  display: grid;
  padding: 18px 22px;
  align-items: center;
  grid-template-columns: 1fr minmax(280px, 390px) auto;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.chat-mode-switch {
  width: min(310px, 100%);
  flex: 0 0 auto;
}

.chat-reset {
  flex: 0 0 auto;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.message {
  max-width: 78%;
  padding: 13px 15px;
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message.bot {
  align-self: flex-start;
  background: #edf6f5;
  border: 1px solid #c7e8e5;
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--ink);
}

.message.system {
  align-self: center;
  max-width: 92%;
  color: #59677c;
  background: #f4f6f9;
  border: 1px dashed #cbd3df;
}

.reply-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.option-row {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
}

.chip.active,
.chip:hover {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.chip.recommended {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 10px 22px rgba(12, 143, 139, 0.18);
}

.chip.recommended:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.matches-grid,
.care-grid {
  grid-template-columns: 1fr 330px;
}

#matches-view.view.active {
  height: auto;
  min-height: 100%;
}

#matches-view .matches-grid {
  align-items: start;
  height: auto;
  min-height: 100%;
}

#matches-view .panel-wide,
#matches-view .insight-panel {
  align-self: start;
}

.panel-wide,
.insight-panel {
  padding: 22px;
}

.section-heading {
  margin-bottom: 18px;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.provider-list {
  display: grid;
  gap: 12px;
}

.provider-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.provider-card-main {
  display: grid;
  gap: 10px;
}

.provider-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.provider-card p {
  color: var(--ink-soft);
  line-height: 1.4;
}

.provider-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.provider-meta span,
.profile-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.profile-link {
  color: var(--teal-dark);
  border-color: rgba(12, 143, 139, 0.35);
}

.profile-link.muted {
  color: #7c8798;
  border-color: var(--line);
}

.provider-signals {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.35;
}

.provider-caution {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.provider-empty-state {
  background: #f7fbfb;
  border-style: dashed;
}

.score {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-weight: 800;
}

.insight-panel ul {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.task-column {
  min-height: 360px;
  padding: 12px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.task-column h4 {
  margin: 0 0 12px;
}

.task-card {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
}

.task-card strong {
  font-size: 0.95rem;
}

.task-card span,
.risk-item {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.35;
}

.risk-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.risk-item:last-child {
  border-bottom: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px 24px 24px 344px;
  background: rgba(9, 36, 77, 0.48);
}

.modal-backdrop.is-hidden {
  display: none;
}

.sales-modal {
  position: relative;
  width: min(780px, 100%);
  max-height: min(90vh, 760px);
  padding: 28px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(6, 24, 52, 0.28);
}

.modal-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 44px 18px 0;
}

.modal-brand-lockup .business-logo {
  display: grid;
}

.modal-brand-lockup h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.05;
}

.modal-powered {
  display: flex;
  margin-top: 6px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink-soft);
  background: #f3f6f8;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
}

.sales-modal h2 {
  max-width: 680px;
  margin: 0 42px 12px 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
}

.modal-lede {
  max-width: 680px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.price-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price-card.featured {
  border-color: rgba(12, 143, 139, 0.45);
  background: #edf6f5;
}

.price-card span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.price-card strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.price-card p {
  color: var(--ink-soft);
  line-height: 1.35;
}

.sales-points {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.dashboard-preview-links {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 16px 18px;
  background: #eef7f6;
  border: 1px solid rgba(12, 143, 139, 0.34);
  border-radius: 8px;
}

.dashboard-preview-links p {
  color: var(--teal);
  font-size: 1.02rem;
  font-weight: 900;
}

.dashboard-preview-links div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-preview-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
}

.dashboard-preview-links a:hover,
.dashboard-preview-links a:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 143, 139, 0.12);
  outline: none;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 760px) {
  .modal-backdrop {
    padding: 24px;
  }

  body {
    background: var(--paper);
  }

  .app-shell {
    display: block;
    min-height: 100vh;
    overflow: visible;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-height: 42px;
    padding: 0;
    color: var(--ink);
    background: #fff;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0;
  }

  .mobile-menu-button::before {
    content: "☰";
    font-size: 1.5rem;
    line-height: 1;
  }

  .mobile-menu-close {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 10px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 0;
    font-weight: 800;
    font-size: 0;
  }

  .mobile-menu-close::before {
    content: "‹";
    font-size: 2.35rem;
    font-weight: 700;
    line-height: 1;
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 18;
    display: block;
    background: rgba(9, 36, 77, 0.45);
  }

  .mobile-menu-backdrop.is-hidden {
    display: none;
  }

  .side-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 19;
    width: min(100vw, 430px);
    gap: 0;
    padding: 0 0 92px;
    background: #fff;
    border-right: 1px solid #e6eaef;
    box-shadow: 12px 0 34px rgba(18, 33, 56, 0.16);
    overflow: auto;
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  .side-panel.mobile-open {
    transform: translateX(0);
  }

  .brand-lockup {
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 14px 22px;
    background: #fff;
    border-bottom: 1px solid #e6eaef;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand-lockup h1 {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    display: none;
  }

  body.business-brand-mode .brand-lockup h1 {
    font-size: 1.1rem;
  }

  .workflow-nav {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 18px 0 8px;
  }

  .nav-item {
    display: flex;
    justify-items: initial;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 22px;
    gap: 12px;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    border-radius: 0;
    font-size: 1.05rem;
    text-align: left;
    line-height: 1.2;
  }

  .nav-item::after {
    content: "›";
    color: #66707c;
    font-size: 1.8rem;
    line-height: 1;
  }

  .nav-item span {
    display: none;
  }

  .nav-item.active {
    color: var(--teal-dark);
    background: #fff;
    border-color: #edf0f3;
  }

  .workspace {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0 0 96px;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 9;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 12px;
    max-width: none;
    margin: 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e1e6ec;
    backdrop-filter: blur(10px);
    overflow: visible;
  }

  .topbar h2 {
    font-size: 1.15rem;
    line-height: 1.25;
    text-align: center;
  }

  .topbar::after {
    content: "";
    width: 42px;
    height: 42px;
  }

  .intake-layout,
  .matches-grid,
  .care-grid,
  .task-board {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .intake-layout.guided-open {
    grid-template-columns: 1fr;
  }

  .intake-layout.guided-open .chat-panel,
  .intake-layout.guided-open .starter-panel {
    order: initial;
  }

  .view.active,
  .intake-layout,
  .matches-grid,
  .care-grid {
    height: auto;
  }

  .view {
    max-width: none;
    padding: 18px 14px;
  }

  .starter-panel,
  .chat-panel,
  .panel-wide,
  .insight-panel {
    border-radius: 10px;
    box-shadow: none;
  }

  .starter-panel {
    max-height: none;
    padding: 16px;
  }

  .chat-panel {
    grid-template-rows: auto auto auto;
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  .messages {
    min-height: 300px;
    max-height: none;
    overflow: visible;
  }

  .panel-wide,
  .insight-panel {
    padding: 16px;
  }

  .provider-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .score {
    width: 48px;
    height: 48px;
    justify-self: start;
    grid-row: 1;
  }

  .task-column {
    min-height: 0;
  }

  .profile-card,
  .location-card,
  .auth-card {
    margin: 18px 18px 0;
    border-radius: 12px;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 17;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 72px;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #dfe5eb;
    box-shadow: 0 -8px 22px rgba(18, 33, 56, 0.08);
  }

  .mobile-tab {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 58px;
    padding: 4px 2px;
    color: #606a74;
    background: transparent;
    border: 0;
    font-weight: 700;
  }

  .mobile-tab span {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: currentColor;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-tab small {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab.active {
    color: var(--teal-dark);
  }

  .mobile-tab.active span {
    color: #fff;
    background: var(--teal);
    border-color: var(--teal);
  }

  #mobile-more-tab span {
    border: 0;
    border-radius: 0;
    font-size: 1.3rem;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .modal-backdrop {
    padding: 24px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: none;
  }

  .workspace {
    padding: 24px;
  }

  .intake-layout.guided-open {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  }

  .chat-header {
    grid-template-columns: 1fr auto;
  }

  .chat-mode-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .chat-reset {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: auto;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding-right: 0;
    padding-left: 0;
  }

  .chat-header,
  .provider-card {
    grid-template-columns: 1fr;
  }

  .chat-header {
    padding: 14px 14px 12px;
    align-items: stretch;
    gap: 12px;
  }

  .chat-identity h3 {
    font-size: 1.08rem;
  }

  .chat-header p {
    font-size: 0.88rem;
  }

  .chat-mode-switch {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  .chat-reset {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
  }

  .reply-box {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px rgba(18, 33, 56, 0.08);
  }

  .message {
    max-width: 100%;
    padding: 12px 13px;
    font-size: 0.95rem;
  }

  .messages {
    padding: 14px;
    gap: 10px;
  }

  .chat-identity {
    align-items: flex-start;
  }

  .business-logo.small {
    width: 38px;
    height: 38px;
  }

  .mode-switch {
    gap: 4px;
  }

  .mode-button {
    min-height: 40px;
    font-size: 0.92rem;
  }

  .option-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .option-row::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 13px;
    font-size: 0.92rem;
  }

  select,
  input {
    min-height: 48px;
    padding: 0 13px;
  }

  .reply-box input {
    min-width: 0;
  }

  .reply-box .primary-button {
    min-width: 76px;
    padding: 0 14px;
  }

  .filter-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .filter-strip::-webkit-scrollbar {
    display: none;
  }

  .section-heading {
    margin-bottom: 12px;
  }

  .provider-card h4 {
    font-size: 0.98rem;
    line-height: 1.2;
  }

  .provider-card p,
  .provider-signals,
  .insight-panel ul {
    font-size: 0.92rem;
  }

  .provider-meta {
    gap: 5px;
  }

  .provider-meta span,
  .profile-link {
    min-height: 24px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .insight-panel {
    display: none;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .sales-modal {
    padding: 22px;
  }

  .modal-actions {
    display: grid;
  }
}
