:root {
  --ink: #0e1620;
  --ink-soft: #1a2634;
  --steel: #3d6e9e;
  --steel-dark: #2f5880;
  --platinum: #9db3cc;
  --paper: #ffffff;
  --mist: #f3f6f9;
  --line: #dce4ec;
  --text: #263442;
  --muted: #657585;
  --danger: #a73535;
  --warning: #a86716;
  --success: #26724f;
  --shadow: 0 20px 55px rgba(14, 22, 32, .13);
}

* { box-sizing: border-box; }
html { color-scheme: only light; }
body {
  margin: 0;
  color: var(--text);
  background: var(--mist);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
input, select, textarea { color-scheme: light; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--steel-dark); }
.hidden { display: none !important; }
.customer-page {
  background:
    radial-gradient(circle at 12% 4%, rgba(157, 179, 204, .22), transparent 34rem),
    linear-gradient(145deg, #f7f9fb 0%, #eef3f7 55%, #f8fafc 100%);
}

.embed-mode {
  min-width: 0;
  background: var(--paper);
}
.embed-mode .site-header,
.embed-mode .advisor-context,
.embed-mode .app-footer {
  display: none;
}
.embed-mode .customer-shell {
  width: 100%;
  margin: 0;
  display: block;
}
.embed-mode .advisor-card {
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.embed-mode .advisor-card-head { padding: 14px 16px 12px; }
.embed-mode .advisor-card-head h2 { font-size: 19px; }
.embed-mode .progress-wrap { padding: 12px 16px; }
.embed-mode .conversation {
  height: clamp(210px, 35vh, 420px);
  padding: 16px;
}
.embed-mode .interaction {
  min-height: 0;
  padding: 16px 16px 20px;
}
.embed-mode .choice-grid { grid-template-columns: 1fr; }

.site-header {
  min-height: 78px;
  padding: 12px clamp(18px, 4vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.phone-link { font-weight: 750; text-decoration: none; }

.customer-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 42px auto;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
}
.advisor-context {
  position: sticky;
  top: 24px;
  padding: 20px 6px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--steel);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.advisor-context h1, .dashboard-toolbar h1, .login-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.03;
  letter-spacing: -.04em;
}
.advisor-context > p:not(.eyebrow) { line-height: 1.65; color: var(--muted); }
.trust-list { list-style: none; padding: 0; margin: 28px 0; }
.trust-list li {
  margin: 12px 0;
  padding-left: 24px;
  position: relative;
}
.trust-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--steel);
  font-weight: 900;
}
.safety-card {
  padding: 16px;
  color: #445363;
  background: #e9eff5;
  border: 1px solid #cbd8e4;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}
.safety-card p { margin: 6px 0 0; }

.advisor-card, .login-card, .lead-list-card, .lead-detail {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.advisor-card {
  min-height: 720px;
  overflow: hidden;
  border-radius: 24px;
  border-color: #cbd8e4;
  box-shadow: 0 28px 80px rgba(14, 22, 32, .16);
}
.advisor-card-head {
  padding: 22px 26px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: white;
  background:
    linear-gradient(135deg, rgba(61, 110, 158, .48), transparent 45%),
    var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.advisor-card-head .eyebrow { color: #c8d8e8; }
.advisor-card-head h2 { margin: 0; color: white; font-size: 24px; }
.assistant-live-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 3px;
  background: #77d4aa;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(119, 212, 170, .13);
}
.advisor-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}
.advisor-card-head .text-button,
.human-contact-link,
.human-email-link {
  padding: 7px 9px;
  color: #eef5fb;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}
.human-contact-link {
  color: var(--ink);
  background: #d4e3f0;
  border-color: #d4e3f0;
}
.advisor-card-head .text-button:hover,
.human-contact-link:hover,
.human-email-link:hover {
  color: white;
  background: rgba(255, 255, 255, .16);
  text-decoration: none;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--steel-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.text-button:hover { text-decoration: underline; }
.progress-wrap { padding: 16px 26px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.progress-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.progress-track { height: 5px; margin-top: 10px; overflow: hidden; background: #e5ebf0; border-radius: 99px; }
#progress-bar { display: block; width: 0; height: 100%; background: var(--steel); transition: width .25s ease; }

.conversation {
  height: 390px;
  padding: 24px 26px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(255, 255, 255, .84), rgba(246, 249, 252, .94)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(61, 110, 158, .04) 31px 32px);
}
.message {
  width: fit-content;
  max-width: min(82%, 600px);
  margin: 0 0 14px;
  padding: 12px 15px;
  border-radius: 12px;
  line-height: 1.5;
  white-space: pre-line;
}
.message.advisor {
  color: var(--text);
  background: white;
  border: 1px solid #d9e3ec;
  border-left: 4px solid var(--steel);
  border-bottom-left-radius: 3px;
  box-shadow: 0 7px 22px rgba(14, 22, 32, .06);
}
.message.customer {
  margin-left: auto;
  color: white;
  background: linear-gradient(135deg, #467ead, var(--steel-dark));
  border-bottom-right-radius: 3px;
  box-shadow: 0 8px 20px rgba(47, 88, 128, .16);
}
.message.staff { color: #5f4a14; background: #fff3cf; }
.message-label {
  display: block;
  margin-bottom: 4px;
  color: inherit;
  opacity: .7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.interaction { min-height: 255px; padding: 24px 26px 28px; border-top: 1px solid var(--line); }
.question-prompt { margin: 0 0 8px; color: var(--ink); font-size: 20px; line-height: 1.25; }
.question-help { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.answer-form { display: grid; gap: 12px; }
.grouped-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grouped-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.grouped-field:first-child:last-child { grid-column: 1 / -1; }
.answer-form input[type="text"],
.answer-form input[type="tel"],
.answer-form input[type="email"],
.answer-form input[type="password"],
.answer-form input[type="search"],
.answer-form select,
.answer-form textarea,
.login-card input,
.filters input,
.filters select,
.editor-grid input,
.editor-grid select,
.editor-grid textarea {
  width: 100%;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
  border: 1px solid #bcc9d5;
  border-radius: 8px;
  outline: none;
}
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(61,110,158,.13); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-button, .slot-button {
  padding: 12px 14px;
  color: var(--ink);
  text-align: left;
  background: white;
  border: 1px solid #c7d3df;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 650;
}
.choice-button:hover, .choice-button:focus, .slot-button:hover, .slot-button:focus { border-color: var(--steel); background: #f2f6fa; }
.check-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  background: white;
  border: 1px solid #c7d3df;
  border-radius: 8px;
}
.check-option input { margin-top: 3px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.primary-button, .secondary-button, .danger-button {
  padding: 11px 17px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}
.primary-button { color: white; background: var(--steel); border: 1px solid var(--steel); }
.primary-button:hover { background: var(--steel-dark); }
.secondary-button { color: var(--ink); background: white; border: 1px solid #b9c6d3; }
.danger-button { color: var(--danger); background: #fff7f7; border: 1px solid #e3bcbc; }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .55; }
.form-error { min-height: 18px; color: var(--danger); font-size: 13px; }
.loading, .empty-state { padding: 28px; color: var(--muted); text-align: center; }
.alert { margin: 16px 26px 0; padding: 12px 14px; color: #573f0e; background: #fff2cd; border: 1px solid #ead28e; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.alert.error { color: #7c2525; background: #fff0f0; border-color: #e4b5b5; }
.alert.success { color: #1f5b40; background: #eaf7f1; border-color: #b9decf; }
.summary-box { max-height: 280px; padding: 16px; overflow: auto; color: #2e3b48; background: #f5f7fa; border: 1px solid var(--line); border-radius: 9px; white-space: pre-wrap; line-height: 1.55; font-size: 13px; }
.correction-box, .schedule-box { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.slot-groups { display: grid; gap: 16px; max-height: 330px; overflow-y: auto; }
.slot-group h4 { margin: 0 0 8px; color: var(--ink); }
.slot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-button { min-width: 110px; text-align: center; }
.appointment-card { padding: 18px; color: #1f5b40; background: #eaf7f1; border: 1px solid #b9decf; border-radius: 10px; }
.upload-list { margin: 10px 0; padding-left: 20px; color: var(--muted); font-size: 13px; }

.app-footer {
  padding: 22px clamp(18px, 4vw, 58px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #b9c6d3;
  background: var(--ink);
  font-size: 12px;
}
.app-footer a { color: white; }

.login-shell { min-height: calc(100vh - 78px); display: grid; place-items: center; padding: 30px; }
.login-card { width: min(440px, 100%); padding: 34px; }
.login-card h1 { font-size: 36px; }
.login-card p { color: var(--muted); line-height: 1.55; }
.login-card label { display: grid; gap: 7px; margin: 20px 0; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.dashboard-shell { width: min(1640px, calc(100% - 30px)); margin: 26px auto 48px; }
.dashboard-toolbar { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.dashboard-toolbar h1 { font-size: 34px; }
.toolbar-copy { max-width: 670px; margin: 9px 0 0; color: var(--muted); line-height: 1.5; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; }
.filters input { width: 250px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(600px, 1.2fr) minmax(430px, .8fr); gap: 18px; align-items: start; }
.lead-list-card { overflow: hidden; }
.table-wrap { min-height: 390px; max-height: calc(100vh - 230px); overflow: auto; }
.lead-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lead-table th { position: sticky; top: 0; z-index: 1; padding: 12px 10px; color: var(--muted); background: #f6f8fa; border-bottom: 1px solid var(--line); text-align: left; text-transform: uppercase; letter-spacing: .06em; }
.lead-table td { padding: 12px 10px; border-bottom: 1px solid #edf1f4; vertical-align: top; }
.lead-table tbody tr { cursor: pointer; }
.lead-table tbody tr:hover, .lead-table tbody tr.selected { background: #eef4f9; }
.lead-table tbody tr:focus { outline: 3px solid rgba(61,110,158,.22); outline-offset: -3px; }
.lead-name-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.lead-name-link:hover { color: var(--steel-dark); text-decoration: underline; }
.table-contact-link { color: var(--steel-dark); font-size: 11px; text-decoration: none; }
.table-contact-link:hover { text-decoration: underline; }
.status-pill, .flag-pill {
  display: inline-block;
  margin: 2px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e8eef4;
  color: #344454;
  font-size: 10px;
  font-weight: 800;
}
.flag-pill.urgent { color: #802323; background: #fde4e4; }
.flag-pill.warning { color: #755019; background: #ffefcf; }
.score-badge { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--steel); border-radius: 50%; font-weight: 850; }
.lead-detail { position: sticky; top: 18px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 22px; }
.detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.detail-head h2 { margin: 0; color: var(--ink); }
.detail-section { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 12px; color: var(--ink); font-size: 15px; }
.detail-grid, .score-grid, .editor-grid { display: grid; gap: 10px; }
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-item { padding: 10px; background: #f7f9fb; border-radius: 7px; }
.detail-item small { display: block; color: var(--muted); margin-bottom: 3px; }
.editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.editor-grid .wide { grid-column: 1 / -1; }
.answer-list, .history-list { display: grid; gap: 8px; }
.answer-row, .history-row { padding: 10px 12px; background: #f7f9fb; border-radius: 7px; font-size: 12px; line-height: 1.45; }
.answer-row strong, .history-row strong { display: block; color: var(--ink); margin-bottom: 3px; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 0; border-bottom: 1px solid #edf1f4; font-size: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.note-form { display: grid; gap: 8px; }
.note-form textarea { min-height: 75px; }
details { border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
summary { padding: 10px 12px; cursor: pointer; font-weight: 750; }
details > div { padding: 0 12px 12px; }

.record-nav {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.record-nav .secondary-button { display: inline-block; text-decoration: none; }
.lead-record-view .lead-detail {
  position: static;
  max-height: none;
  overflow: visible;
  padding: clamp(24px, 4vw, 54px);
  border-radius: 22px;
}
.record-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.record-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 64px);
  line-height: .98;
  letter-spacing: -.045em;
}
.record-hero p:not(.eyebrow) { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.record-score {
  min-width: 106px;
  padding: 18px;
  color: white;
  text-align: center;
  background: linear-gradient(145deg, var(--steel), var(--ink));
  border-radius: 18px;
}
.record-score strong { display: block; font-size: 38px; line-height: 1; }
.record-score span { display: block; margin-top: 7px; color: #d9e5ef; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.record-contact-actions {
  margin: 22px 0 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.record-contact-action {
  min-width: 0;
  padding: 14px 16px;
  color: var(--ink);
  background: #edf3f8;
  border: 1px solid #cfdae5;
  border-radius: 12px;
  text-decoration: none;
}
.record-contact-action:hover { background: #e2ecf4; border-color: var(--steel); }
.record-contact-action strong,
.record-contact-action small { display: block; overflow: hidden; text-overflow: ellipsis; }
.record-contact-action strong { font-size: 12px; }
.record-contact-action small { margin-top: 4px; color: var(--muted); white-space: nowrap; }
.record-contact-action.disabled { opacity: .55; }
.record-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.record-section:first-of-type { border-top: 0; }
.section-heading {
  margin-bottom: 17px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.section-heading h2 { margin: 0; color: var(--ink); font-size: clamp(21px, 2.4vw, 30px); letter-spacing: -.025em; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.detail-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-item {
  min-width: 0;
  padding: 12px 0;
  background: transparent;
  border-bottom: 1px solid #e5ebf0;
}
.detail-item a { font-weight: 750; text-decoration: none; overflow-wrap: anywhere; }
.detail-item a:hover { text-decoration: underline; }
.record-summary { max-height: none; margin-top: 20px; padding: 20px; font-size: 14px; }
.record-section-pair { display: grid; grid-template-columns: 1.45fr .55fr; gap: 34px; }
.record-history { margin-top: 14px; }
.record-disclosures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.record-disclosures details { margin: 0; }
.lead-record-view .editor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lead-record-view .answer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.lead-record-view .answer-row {
  padding: 14px 0;
  background: transparent;
  border-bottom: 1px solid #e5ebf0;
  font-size: 13px;
}
.empty-copy { color: var(--muted); }
.photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.photo-thumb {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  text-align: left;
  background: #f5f8fa;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: zoom-in;
}
.photo-thumb:hover, .photo-thumb:focus { border-color: var(--steel); box-shadow: 0 10px 25px rgba(14, 22, 32, .12); }
.photo-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 0; border-radius: 0; }
.photo-thumb span { display: block; padding: 9px 11px; overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.photo-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 20px;
  color: white;
  background: rgba(7, 12, 18, .96);
  border: 0;
}
.photo-lightbox::backdrop { background: rgba(7, 12, 18, .88); }
.lightbox-toolbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.lightbox-toolbar > span { margin-right: auto; color: #d4e0ea; font-size: 13px; font-weight: 800; }
.lightbox-toolbar a,
.lightbox-toolbar button {
  padding: 9px 12px;
  color: white;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
#lightbox-close { width: 42px; font-size: 24px; line-height: 1; }
.lightbox-stage {
  height: calc(100vh - 120px);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 12px;
}
.lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  margin: auto;
  object-fit: contain;
}
.lightbox-nav {
  width: 52px;
  height: 68px;
  color: white;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  cursor: pointer;
  font-size: 44px;
  line-height: 1;
}
#lightbox-caption { margin: -24px 70px 0; color: #c8d5df; text-align: center; font-size: 12px; }

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .lead-detail { position: static; max-height: none; }
  .table-wrap { max-height: 520px; }
  .record-section-pair { grid-template-columns: 1fr; gap: 0; }
  .detail-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-record-view .editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .customer-shell { grid-template-columns: 1fr; margin-top: 18px; }
  .advisor-context { position: static; padding-bottom: 0; }
  .advisor-context h1 { font-size: 36px; }
  .trust-list, .safety-card { display: none; }
  .advisor-card { min-height: 680px; }
  .dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .filters input { width: 100%; }
  .record-contact-actions { grid-template-columns: 1fr; }
  .record-contact-action small { white-space: normal; }
  .lead-record-view .answer-grid { grid-template-columns: 1fr; }
  .record-disclosures { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .site-header { min-height: 68px; padding: 10px 14px; }
  .phone-link { font-size: 12px; }
  .brand strong { font-size: 13px; }
  .brand small { font-size: 9px; }
  .brand-mark { width: 38px; height: 38px; }
  .customer-shell { width: calc(100% - 18px); }
  .advisor-card-head, .progress-wrap, .conversation, .interaction { padding-left: 16px; padding-right: 16px; }
  .advisor-card-head { align-items: start; flex-direction: column; }
  .advisor-head-actions { width: 100%; justify-content: flex-start; }
  .advisor-card-head .text-button { max-width: none; }
  .conversation { height: 310px; }
  .choice-grid { grid-template-columns: 1fr; }
  .grouped-fields { grid-template-columns: 1fr; }
  .message { max-width: 92%; }
  .app-footer { flex-direction: column; }
  .dashboard-shell { width: calc(100% - 14px); }
  .detail-grid, .editor-grid { grid-template-columns: 1fr; }
  .editor-grid .wide { grid-column: auto; }
  .record-nav { align-items: start; flex-direction: column; }
  .lead-record-view .lead-detail { padding: 22px 16px; border-radius: 14px; }
  .record-hero { align-items: start; flex-direction: column; }
  .record-score { min-width: 0; width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .record-score strong { font-size: 30px; }
  .record-score span { margin: 0; }
  .detail-grid-wide,
  .lead-record-view .editor-grid { grid-template-columns: 1fr; }
  .lead-record-view .editor-grid .wide { grid-column: auto; }
  .photo-grid { grid-template-columns: 1fr; }
  .lightbox-stage { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 5px; }
  .lightbox-nav { width: 40px; height: 58px; font-size: 36px; }
  #lightbox-caption { margin-left: 46px; margin-right: 46px; }
}
