:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #65748b;
  --line: #e4e9f1;
  --blue: #1d83f2;
  --green: #11bf86;
  --cyan: #12c7d7;
  --amber: #f59e0b;
  --red: #e05252;
  --shadow: 0 10px 24px rgba(15, 35, 70, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 52px;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
}

.config-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 14px;
  white-space: nowrap;
}

.config-pill.ok {
  color: #087b5a;
  background: #e9fff7;
  border-color: #bdf4df;
}

.config-pill.warn {
  color: #945a00;
  background: #fff7e5;
  border-color: #f7d38a;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.metric,
.panel,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 92px;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric span {
  color: var(--muted);
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.runtime-panel {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.runtime-panel-head > div > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.runtime-item {
  display: grid;
  gap: 7px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfe;
  padding: 14px;
}

.runtime-item > span,
.runtime-item > small,
.muted {
  color: var(--muted);
}

.runtime-item > strong {
  font-size: 21px;
}

.runtime-details {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  margin-top: 14px;
}

.runtime-details > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.runtime-details h3 {
  margin: 0 0 11px;
  font-size: 14px;
}

.runtime-notify {
  margin: -3px 0 11px;
  font-size: 13px;
}

.runtime-list {
  display: grid;
  gap: 8px;
}

.runtime-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 7px;
}

.runtime-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.runtime-ok {
  color: #087b5a;
}

.runtime-warn {
  color: #945a00;
}

.runtime-bad {
  color: #b42323;
}

.runtime-alert {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--amber);
  background: #fffaf0;
  padding: 9px 11px;
}

.runtime-alert.danger {
  border-left-color: var(--red);
  background: #fff7f7;
}

.runtime-alert.resolved {
  border-left-color: var(--green);
  background: #f2fff9;
}

.runtime-alert span,
.runtime-alert small,
.runtime-history {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.runtime-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.danger-link.compact {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.panel,
.table-panel {
  border-radius: 8px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #334155;
  font-weight: 600;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.import-form textarea {
  min-height: 170px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(29, 131, 242, 0.68);
  box-shadow: 0 0 0 3px rgba(29, 131, 242, 0.12);
}

button {
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary {
  grid-column: 1 / -1;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.secondary {
  color: white;
  background: var(--text);
}

.ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}

.employee-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.employee-list {
  display: grid;
  gap: 10px;
}

.employee-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.supervisor-row {
  grid-template-columns: 1fr auto auto;
}

.danger-link {
  min-height: 36px;
  border: 1px solid #f1b7b7;
  background: #fff7f7;
  color: #b42323;
  padding: 0 12px;
}

.employee-row strong {
  display: block;
  margin-bottom: 3px;
}

.employee-row small {
  color: var(--muted);
  word-break: break-all;
}

.supervisor-config {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.supervisor-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.supervisor-config-head strong,
.supervisor-config-head small {
  display: block;
}

.supervisor-config-head small {
  margin-top: 4px;
  color: var(--muted);
}

.supervisor-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 10px;
  margin-bottom: 12px;
}

.import-result {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfe;
  padding: 12px;
}

.import-result[hidden] {
  display: none;
}

.import-result strong {
  font-size: 14px;
}

.import-result small {
  color: var(--muted);
}

.import-lines {
  display: grid;
  gap: 8px;
}

.import-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.import-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-line b {
  font-size: 12px;
  white-space: nowrap;
}

.import-line .ok {
  color: #087b5a;
}

.import-line .fail {
  color: #b42323;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.table-panel {
  margin-top: 16px;
  padding: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: #f9fbfe;
  white-space: nowrap;
}

td {
  line-height: 1.4;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.customer-name {
  font-weight: 700;
}

.phone {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.green {
  color: #087b5a;
  background: #e9fff7;
}

.badge.blue {
  color: #0b62bf;
  background: #eaf4ff;
}

.badge.amber {
  color: #945a00;
  background: #fff3d7;
}

.badge.red {
  color: #b42323;
  background: #fff0f0;
}

.status-select {
  min-width: 118px;
  padding: 8px 10px;
}

.notify-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.link-button {
  min-height: 26px;
  border: 1px solid rgba(29, 131, 242, 0.24);
  background: #f6fbff;
  color: var(--blue);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.link-button:disabled {
  color: var(--muted);
  cursor: wait;
  opacity: 0.72;
}

.empty {
  color: var(--muted);
  text-align: center;
  height: 86px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 12px 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.detail-body .toast {
  right: auto;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  white-space: nowrap;
}

.detail-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(29, 131, 242, 0.16), transparent 34vw),
    radial-gradient(circle at bottom right, rgba(17, 191, 134, 0.16), transparent 32vw),
    var(--bg);
}

.lead-detail-shell {
  width: min(720px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0;
}

.lead-card {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.lead-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.lead-detail-head h1 {
  margin: 12px 0 6px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.lead-detail-head p {
  margin: 0;
  color: var(--muted);
}

.lead-status-block {
  display: grid;
  grid-template-columns: 160px auto;
  gap: 10px;
  align-items: end;
}

.lead-phone-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
  border: 1px solid rgba(29, 131, 242, 0.2);
  border-radius: 8px;
  background: #f6fbff;
  padding: 16px;
}

.consultation-overview {
  margin: 18px 0 0;
  border: 1px solid #f1cf8b;
  border-radius: 8px;
  background: #fff9e9;
  padding: 15px 16px;
}

.consultation-overview > div > span {
  display: block;
  margin-bottom: 5px;
  color: #9a6200;
  font-size: 12px;
  font-weight: 800;
}

.consultation-overview > div > strong {
  display: block;
  color: #3f2a00;
  line-height: 1.5;
}

.consultation-overview dl {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin: 12px 0 0;
}

.consultation-overview dl > div {
  display: flex;
  gap: 6px;
  font-size: 13px;
}

.consultation-overview dt {
  color: var(--muted);
}

.consultation-overview dd {
  margin: 0;
  color: #3f2a00;
  font-weight: 700;
}

.consultation-overview p {
  margin: 12px 0 0;
  border-top: 1px dashed #e3c580;
  padding-top: 12px;
  color: #59420d;
  font-size: 13px;
  line-height: 1.6;
}

.lead-phone-box span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

.lead-phone-box strong {
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.call-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.lead-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lead-profile,
.contact-records {
  margin-top: 22px;
}

.lead-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.lead-section-head h2 {
  margin: 0;
  font-size: 18px;
}

.lead-section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.contact-record-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #edf6ff;
  color: var(--blue);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.contact-record-list {
  display: grid;
  gap: 10px;
}

.contact-record {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
}

.contact-record-rail {
  position: relative;
  width: 10px;
}

.contact-record-rail::before {
  position: absolute;
  top: 8px;
  left: 1px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  content: "";
}

.contact-record:not(:last-child) .contact-record-rail::after {
  position: absolute;
  top: 20px;
  bottom: -16px;
  left: 4px;
  width: 2px;
  background: var(--line);
  content: "";
}

.contact-record.follow .contact-record-rail::before {
  background: var(--green);
}

.contact-record.update .contact-record-rail::before {
  background: #d28a00;
}

.contact-record-main {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.contact-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contact-record-type {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.contact-record.follow .contact-record-type {
  color: #087b5a;
}

.contact-record.update .contact-record-type {
  color: #945a00;
}

.contact-record-head h3 {
  margin: 0;
  font-size: 15px;
}

.contact-record-head time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.contact-record-main > p {
  margin: 10px 0 0;
  color: #25324a;
  line-height: 1.65;
}

.contact-record-latest {
  margin-top: 10px;
  border-radius: 6px;
  background: #f7fafc;
  color: #536178;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.lead-info-item {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.lead-info-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lead-info-item strong {
  display: block;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.lead-link,
.detail-link {
  color: var(--blue);
  text-decoration: none;
}

.lead-link:hover,
.detail-link:hover {
  text-decoration: underline;
}

.notify-cell {
  min-width: 130px;
}

.push-preview {
  margin-top: 8px;
}

.push-preview summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.push-preview-meta {
  margin: 9px 0 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.push-supervisor-meta {
  border-top: 1px dashed var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.push-preview pre,
.push-message-content {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #25324a;
  font: 13px/1.65 "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.push-preview pre {
  width: min(420px, 70vw);
  max-height: 280px;
  overflow: auto;
  padding: 12px;
}

.push-preview .detail-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
}

.push-record-card {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: transparent;
}

.push-records {
  margin-top: 16px;
}

.push-record-list {
  display: grid;
  gap: 0;
}

.push-record-card > time {
  color: #8895a6;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.push-record-card > div {
  min-width: 0;
}

.push-record-card strong,
.push-record-card small {
  display: block;
}

.push-record-card strong {
  color: #2d3a4e;
  font-size: 14px;
}

.push-record-card small {
  margin-top: 3px;
  color: #8995a6;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.push-record-status {
  justify-self: end;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.push-record-status.success {
  color: #16875a;
  background: #e8f8ef;
}

.push-record-status.failed {
  color: #c04747;
  background: #fff0f0;
}

.push-record-status.muted,
.push-record-status.pending {
  color: #8c6a22;
  background: #fff6df;
}

.detail-loading,
.detail-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}

.detail-empty h1 {
  margin: 0 0 10px;
  color: var(--text);
}

.my-leads-shell {
  width: min(760px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.my-leads-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.my-leads-eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.my-leads-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.my-leads-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.my-leads-refresh {
  min-width: 68px;
}

.my-leads-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid #dceafe;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f7ff, #f7fffc);
}

.my-leads-summary strong {
  color: var(--blue);
  font-size: 31px;
  line-height: 1;
}

.my-leads-summary span {
  color: var(--muted);
}

.my-leads-list {
  display: grid;
  gap: 11px;
}

.my-lead-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(15, 35, 70, 0.05);
  padding: 16px;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.my-lead-card:focus-visible {
  outline: 3px solid rgba(29, 131, 242, 0.28);
  outline-offset: 2px;
}

.my-lead-card:active {
  transform: scale(0.992);
}

.my-lead-card:hover {
  border-color: rgba(29, 131, 242, 0.46);
  box-shadow: var(--shadow);
}

.my-lead-card.returning-customer {
  border-color: #edd293;
  background: linear-gradient(135deg, #fffdf7, #fff 62%);
}

.my-lead-card-head,
.my-lead-meta,
.my-lead-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.my-lead-card-head h2 {
  margin: 0;
  font-size: 17px;
}

.my-lead-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.my-consultation-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

.my-consultation-badge.returning {
  background: #fff1ca;
  color: #965c00;
}

.my-consultation-badge.new {
  background: #eaf4ff;
  color: var(--blue);
}

.my-lead-card-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.my-lead-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 14px;
  color: #40506a;
}

.my-lead-meta span {
  border-radius: 999px;
  background: #f5f8fc;
  padding: 5px 9px;
  font-size: 13px;
}

.my-lead-previous,
.my-lead-summary {
  margin: 11px 0 0;
  color: #536178;
  font-size: 13px;
  line-height: 1.55;
}

.my-lead-previous {
  color: #79540c;
}

.my-lead-summary {
  border-left: 3px solid #d9e8f9;
  background: #f8fbff;
  padding: 8px 10px;
}

.returning-customer .my-lead-summary {
  border-left-color: #ebcf8a;
  background: #fffaf0;
}

.my-lead-footer {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #edf0f4;
  color: var(--muted);
  font-size: 13px;
}

.my-lead-footer strong {
  color: var(--blue);
}

.my-leads-empty {
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 1px dashed #cad4e2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.my-leads-empty h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 18px;
}

.my-leads-empty p {
  margin: 0;
}

.my-leads-empty.error h2 {
  color: var(--red);
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-shell {
  width: min(100%, 420px);
}

.login-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(15, 35, 70, 0.12);
  padding: 38px 34px;
  text-align: center;
}

.login-logo {
  width: 68px;
  height: 68px;
  margin-bottom: 18px;
}

.login-eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.login-card h1 {
  margin: 0;
  font-size: 25px;
}

.login-card > p:not(.login-eyebrow) {
  margin: 12px 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.login-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.login-button:focus-visible {
  outline: 3px solid rgba(29, 131, 242, 0.32);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .runtime-grid,
  .runtime-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    display: grid;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100vw - 20px, 1200px);
    padding-top: 14px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .metrics,
  .runtime-grid,
  .runtime-details,
  .form-grid,
  .employee-form {
    grid-template-columns: 1fr;
  }

  .primary {
    grid-column: auto;
  }

  .employee-row {
    grid-template-columns: 1fr;
  }

  .supervisor-form {
    grid-template-columns: 1fr;
  }

  .import-line {
    grid-template-columns: 1fr;
  }

  .lead-card {
    padding: 16px;
  }

  .lead-detail-head,
  .lead-status-block,
  .lead-phone-box,
  .lead-info-grid {
    grid-template-columns: 1fr;
  }

  .lead-detail-head h1 {
    font-size: 24px;
  }

  .lead-phone-box strong {
    font-size: 25px;
  }

  .my-leads-shell {
    width: min(100vw - 20px, 760px);
    padding-top: 18px;
  }

  .my-leads-header {
    gap: 12px;
  }

  .my-leads-header h1 {
    font-size: 24px;
  }

  .my-lead-card-head,
  .my-lead-footer {
    align-items: flex-start;
  }
}

/* 客户线索详情：移动端优先，桌面端保持同样清晰的卡片层级 */
html.lead-detail-page {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.detail-body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #f4f6fa;
}

.lead-detail-shell {
  width: min(760px, calc(100vw - 28px));
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 0 104px;
}

.lead-card.lead-detail-mobile {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.lead-mobile-nav {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  min-height: 52px;
  align-items: center;
  margin-bottom: 12px;
}

.lead-mobile-nav h1 {
  margin: 0;
  color: #101828;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .02em;
  text-align: center;
}

.lead-nav-back,
.lead-nav-menu,
.lead-reveal-phone,
.lead-copy-phone,
.lead-dialog-close {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1e293b;
  cursor: pointer;
}

.lead-nav-back {
  text-decoration: none;
}

.lead-nav-back:hover,
.lead-nav-menu:hover,
.lead-reveal-phone:hover {
  background: #eaf1fb;
}

@media (hover: hover) {
  .lead-copy-phone:hover {
    background: #eaf1fb;
  }
}

.lead-mobile-nav svg,
.lead-assignment-banner svg,
.lead-action svg,
.lead-follow-icon svg,
.repeat-consultation-item > svg,
.lead-returning-tag svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-nav-menu svg circle {
  fill: currentColor;
  stroke: none;
}

.lead-assignment-banner {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 56px;
  margin: 0 0 16px;
  border: 1px solid #dceaff;
  border-radius: 14px;
  background: linear-gradient(100deg, #eff6ff, #f7faff);
  color: #3978db;
  padding: 12px 15px;
  font-weight: 700;
}

.lead-assignment-banner.returning {
  border-color: #f1d58e;
  background: linear-gradient(100deg, #fff7e5, #fffdf8);
  color: #b68017;
}

.lead-assignment-banner time {
  color: #9aa5b5;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.lead-identity-card,
.repeat-consultation-card,
.lead-detail-tabs,
.push-records {
  border: 1px solid #e8edf4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(35, 58, 89, .045);
}

.lead-identity-card {
  padding: 20px;
}

.lead-person-head {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.lead-avatar {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #428dff, #1964e9);
  box-shadow: inset 0 -8px 14px rgba(9, 64, 164, .16);
  color: #fff;
  font-size: 27px;
  font-weight: 800;
}

.lead-person-main {
  min-width: 0;
}

.lead-name-row,
.lead-phone-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.lead-name-row h2 {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--lead-customer-text, #1d2736);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-name-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #eaf3ff;
  color: #3978db;
}

.lead-name-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-intent-badge {
  flex: 0 0 auto;
  margin-left: auto;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.lead-intent-badge.high {
  background: #e7f0ff;
  color: #2974df;
}

.lead-intent-badge.warm {
  background: #fff0d6;
  color: #a36500;
}

.lead-intent-badge.normal {
  background: #eef2f7;
  color: #64748b;
}

.lead-phone-row {
  margin-top: 5px;
}

.lead-phone-row strong {
  color: var(--lead-customer-text, #1d2736);
  font-size: 20px;
  letter-spacing: .035em;
}

.lead-reveal-phone {
  width: 30px;
  height: 30px;
  color: #94a0b1;
}

.lead-copy-phone {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #3978db;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.lead-copy-phone:active {
  background: #e5efff;
  transform: scale(.95);
}

.lead-copy-phone:focus-visible {
  box-shadow: 0 0 0 3px rgba(67, 129, 219, .2);
}

.lead-copy-phone svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-phone-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #eaf3ff;
  color: #3978db;
}

.lead-phone-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phone-glyph,
.lead-phone-icon .phone-glyph,
.lead-action .phone-glyph,
.lead-follow-icon .phone-glyph {
  fill: currentColor;
  stroke: none;
}

.lead-reveal-phone svg {
  width: 18px;
  height: 18px;
}

.lead-person-main > p {
  margin: 5px 0 0;
  color: #98a1af;
  font-size: 13px;
}

.lead-returning-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 7px;
  background: #fff4e4;
  color: #e37a11;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.lead-returning-tag svg {
  width: 13px;
  height: 13px;
}

.lead-summary-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
  margin: 20px 0 0;
}

.lead-summary-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 11px 0;
}

.lead-summary-field.wide {
  grid-column: 1 / -1;
}

.lead-summary-field dt,
.lead-profile-list dt {
  color: #778397;
  font-size: 14px;
}

.lead-summary-field dd,
.lead-profile-list dd {
  min-width: 0;
  margin: 0;
  color: #1d2736;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.repeat-consultation-card {
  margin-top: 16px;
  padding: 18px 20px;
}

.repeat-consultation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repeat-consultation-heading h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
}

.repeat-consultation-heading > span {
  color: #8290a4;
  font-size: 12px;
}

.repeat-consultation-list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.repeat-consultation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  border-radius: 12px;
  padding: 11px 8px;
}

.repeat-consultation-item.latest {
  background: linear-gradient(100deg, #eef5ff, #fbfdff);
  padding-right: 12px;
  padding-left: 12px;
}

.repeat-consultation-time {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.repeat-consultation-time strong {
  color: #1d2736;
  font-size: 15px;
}

.repeat-latest-badge,
.repeat-current-badge {
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.repeat-latest-badge {
  background: #367cf0;
  color: #fff;
}

.repeat-current-badge {
  background: #dfeeff;
  color: #2a73dc;
}

.repeat-consultation-item p,
.repeat-consultation-item small {
  display: block;
  margin: 5px 0 0;
  color: #8b96a6;
  font-size: 13px;
}

.repeat-consultation-item small {
  color: #68768a;
}

.repeat-consultation-item > svg {
  width: 18px;
  height: 18px;
  color: #a9b3c0;
}

.lead-detail-tabs {
  margin-top: 16px;
  overflow: hidden;
}

.lead-tab-list {
  display: flex;
  justify-content: center;
  gap: 34px;
  border-bottom: 1px solid #edf0f4;
  padding: 0 20px;
}

.lead-detail-tab {
  position: relative;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: #8490a2;
  cursor: pointer;
  font-size: 17px;
  font-weight: 750;
}

.lead-detail-tab.active {
  color: #256fe4;
}

.lead-detail-tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: #2876ed;
  content: "";
}

.lead-tab-panel {
  padding: 18px 20px;
}

.lead-follow-timeline {
  display: grid;
}

.lead-follow-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 13px;
  min-height: 105px;
  padding: 0 0 18px;
}

.lead-follow-item:not(:last-child)::before {
  position: absolute;
  top: 38px;
  bottom: 0;
  left: 19px;
  width: 2px;
  background: #e6ecf3;
  content: "";
}

.lead-follow-icon {
  z-index: 1;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #eaf3ff;
  color: #3978db;
}

.lead-follow-item.follow .lead-follow-icon {
  background: #e8f8ef;
  color: #219a68;
}

.lead-follow-item.update .lead-follow-icon {
  background: #fff1e4;
  color: #d9832e;
}

.lead-follow-icon svg {
  width: 19px;
  height: 19px;
}

.lead-follow-main {
  min-width: 0;
  padding-top: 1px;
}

.lead-follow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.lead-follow-head strong {
  color: #1a2332;
  font-size: 16px;
}

.lead-follow-head time,
.lead-follow-type {
  color: #929dac;
  font-size: 12px;
}

.lead-follow-type {
  display: inline-block;
  margin-top: 2px;
}

.lead-follow-main p,
.lead-follow-latest {
  margin: 8px 0 0;
  border-radius: 9px;
  background: #f5f7fa;
  color: #5d697a;
  padding: 9px 11px;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.lead-follow-latest {
  border-left: 3px solid #b9d5ff;
  background: #f7fbff;
  color: #536e92;
}

.lead-empty-record {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 150px;
  place-content: center;
  color: #8793a3;
  text-align: center;
}

.lead-empty-record strong {
  color: #4f5d70;
  font-size: 16px;
}

.lead-profile-list {
  display: grid;
  margin: 0;
}

.lead-profile-list > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #f0f2f5;
}

.lead-profile-list > div:last-child {
  border-bottom: 0;
}

.push-records {
  margin-top: 16px;
}

.lead-action-bar {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  display: grid;
  width: min(760px, 100vw);
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  transform: translateX(-50%);
  border-top: 1px solid #e5eaf1;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -8px 26px rgba(32, 52, 78, .08);
  padding: 11px max(14px, env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.lead-action {
  display: inline-flex;
  min-width: 0;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease;
}

.lead-action:active {
  transform: scale(.985);
}

.lead-action svg {
  width: 17px;
  height: 17px;
}

.lead-action.secondary {
  border: 1px solid #dbe9ff;
  background: #f1f6ff;
  color: #2874e8;
}

.lead-action.primary {
  border: 1px solid #2469d7;
  background: linear-gradient(135deg, #367ff1, #1761dc);
  color: #fff;
  cursor: pointer;
}

.lead-action:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.lead-follow-sheet[hidden] {
  display: none;
}

.lead-follow-sheet {
  position: fixed;
  z-index: 50;
  inset: 0;
}

.lead-follow-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, .38);
}

.lead-follow-dialog {
  position: absolute;
  right: 50%;
  bottom: 0;
  width: min(760px, 100vw);
  transform: translateX(50%);
  border-radius: 20px 20px 0 0;
  background: #fff;
  box-shadow: 0 -14px 40px rgba(15, 23, 42, .18);
  padding: 20px 20px calc(22px + env(safe-area-inset-bottom));
}

.lead-follow-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.lead-follow-dialog-head span {
  color: #2e75e3;
  font-size: 12px;
  font-weight: 800;
}

.lead-follow-dialog-head h2 {
  margin: 5px 0 0;
  color: #172033;
  font-size: 21px;
}

.lead-submission-conversation-meta {
  margin: 5px 0 0;
  color: #8a96a7;
  font-size: 12px;
  line-height: 1.35;
}

.lead-dialog-close {
  color: #8d99a9;
  font-size: 28px;
}

.lead-follow-dialog form {
  display: grid;
  gap: 14px;
}

.lead-follow-dialog label {
  display: grid;
  gap: 8px;
  color: #536176;
  font-size: 14px;
  font-weight: 700;
}

.lead-form-select,
.lead-follow-dialog textarea {
  width: 100%;
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  outline: none;
  background: #fbfcfe;
  color: #192334;
  padding: 11px 12px;
}

.lead-follow-dialog textarea {
  resize: vertical;
  line-height: 1.6;
}

.lead-form-select:focus,
.lead-follow-dialog textarea:focus {
  border-color: #4a90f8;
  box-shadow: 0 0 0 3px rgba(58, 132, 240, .13);
}

.lead-save-follow {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #367ff1, #1761dc);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.lead-save-follow:disabled {
  opacity: .7;
}

@media (max-width: 620px) {
  .lead-detail-shell {
    width: min(100vw - 20px, 760px);
    padding-top: 6px;
  }

  .lead-mobile-nav h1 {
    font-size: 20px;
  }

  .lead-identity-card,
  .repeat-consultation-card {
    border-radius: 15px;
    padding: 16px;
  }

  .lead-person-head {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .lead-avatar {
    width: 54px;
    height: 54px;
    font-size: 23px;
  }

  .lead-name-row h2 {
    font-size: 20px;
  }

  .lead-returning-tag {
    grid-column: 2;
    justify-self: start;
    margin-top: -6px;
  }

  .lead-summary-fields {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 14px;
  }

  .lead-summary-field,
  .lead-summary-field.wide {
    grid-column: auto;
    grid-template-columns: 82px minmax(0, 1fr);
    padding: 8px 0;
  }

  .lead-tab-panel {
    padding: 16px;
  }

  .lead-tab-list {
    gap: 26px;
  }

  .lead-detail-tab {
    min-height: 48px;
    font-size: 16px;
  }

  .lead-action-bar {
    padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .lead-action {
    min-height: 44px;
    gap: 5px;
    font-size: 13px;
  }

  .lead-action svg {
    width: 16px;
    height: 16px;
  }
}

/* 详情页按销售接待的阅读顺序分为六个固定栏目。 */
.lead-info-section {
  margin-top: 14px;
  border: 1px solid #e8edf4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(35, 58, 89, .045);
  padding: 19px 20px;
}

.lead-customer-section {
  margin-top: 0;
}

.lead-repeat-summary {
  margin-top: 12px;
}

.lead-repeat-banner {
  display: grid;
  width: 100%;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(100deg, #fff0f0, #fff7f7);
  color: #a75b60;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

.lead-repeat-banner strong {
  color: #e0545c;
  font-weight: 850;
}

.lead-repeat-banner-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #ffadb2;
  color: #fff;
}

.lead-repeat-banner-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-repeat-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #a67d80;
  font-size: 12px;
  white-space: nowrap;
}

.lead-repeat-banner-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-body {
  touch-action: manipulation;
}

.lead-customer-overview {
  display: block;
  align-items: start;
}

.lead-customer-primary {
  --lead-customer-text: #1d2736;
  min-width: 0;
}

.lead-customer-primary > p {
  margin: 6px 0 0;
  color: #7a8798;
  font-size: 13px;
}

.lead-customer-primary .lead-returning-tag {
  margin-top: 9px;
}

.lead-customer-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 15px 0 0;
  padding-top: 13px;
  border-top: 1px solid #edf1f5;
}

.lead-customer-meta > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.lead-customer-meta > div > div {
  min-width: 0;
}

.lead-customer-meta-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
}

.lead-customer-meta-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-customer-meta-icon.blue { background: #eaf3ff; color: #3978db; }
.lead-customer-meta-icon.purple { background: #f2ecff; color: #8e63d2; }
.lead-customer-meta-icon.orange { background: #fff1e4; color: #d9832e; }
.lead-customer-meta-icon.green { background: #e8f8ef; color: #219a68; }

.lead-customer-meta dt {
  color: #8793a4;
  font-size: 12px;
}

.lead-customer-meta dd {
  min-width: 0;
  margin: 0;
  color: #314056;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.lead-detail-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.lead-detail-section-title h2 {
  margin: 0;
  color: #172033;
  font-size: 18px;
  font-weight: 800;
}

.lead-detail-section-title span {
  color: #2d75df;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.lead-section-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
  margin: 16px 0 0;
}

.lead-section-field {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 10px 0;
}

.lead-section-field.wide {
  grid-column: 1 / -1;
}

.lead-section-field dt {
  color: #7c899c;
  font-size: 14px;
}

.lead-section-field dd {
  min-width: 0;
  margin: 0;
  color: #1b2637;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.lead-remark-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 22px;
}

.lead-remark-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  min-width: 0;
}

.lead-remark-item.wide {
  grid-column: 1 / -1;
}

.lead-remark-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
}

.lead-remark-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-remark-icon.blue { background: #eaf3ff; color: #3978db; }
.lead-remark-icon.purple { background: #f2ecff; color: #8e63d2; }
.lead-remark-icon.green { background: #e8f8ef; color: #219a68; }
.lead-remark-icon.orange { background: #fff1e4; color: #d9832e; }
.lead-remark-icon.amber { background: #fff5db; color: #b68017; }
.lead-remark-icon.cyan { background: #e7f7fb; color: #278fa3; }
.lead-remark-icon.teal { background: #e7f7f2; color: #238e73; }

.lead-remark-item > div {
  min-width: 0;
}

.lead-remark-item > div > span {
  display: block;
  color: #8a96a7;
  font-size: 12px;
  line-height: 1.2;
}

.lead-remark-item > div > strong {
  display: block;
  margin-top: 4px;
  color: #293548;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lead-submission-section {
  scroll-margin-top: 16px;
}

.lead-submission-highlight {
  animation: leadSubmissionHighlight 1.3s ease-out;
}

@keyframes leadSubmissionHighlight {
  0% { border-color: #8db8ff; box-shadow: 0 0 0 4px rgba(57, 123, 232, .14); }
  100% { border-color: #e8edf4; box-shadow: 0 7px 22px rgba(35, 58, 89, .045); }
}

.lead-submission-list {
  display: grid;
  gap: 0;
  margin-top: 9px;
}

.lead-submission-item {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 14px minmax(0, 1fr) 18px;
  gap: 10px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 13px 0 13px 2px;
  text-align: left;
  cursor: pointer;
}

.lead-submission-item:hover {
  background: #f8fbff;
}

.lead-submission-item + .lead-submission-item {
  border-top: 1px solid #edf1f5;
}

.lead-submission-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #b9c5d4;
}

.lead-submission-item.latest .lead-submission-dot {
  background: #397be8;
  box-shadow: 0 0 0 4px #e6f0ff;
}

.lead-submission-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.lead-submission-head strong {
  color: #263447;
  font-size: 14px;
}

.lead-submission-head time,
.lead-submission-item p,
.lead-submission-item small {
  color: #8995a6;
  font-size: 12px;
}

.lead-submission-item p,
.lead-submission-item small {
  display: block;
  margin: 4px 0 0;
  line-height: 1.45;
}

.lead-submission-item small {
  color: #637187;
}

.lead-submission-chevron {
  align-self: center;
  color: #9ca9ba;
}

.lead-submission-chevron svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-submission-dialog {
  display: flex;
  flex-direction: column;
  max-height: min(82vh, 720px);
  padding-bottom: 0;
  overflow: hidden;
}

.lead-submission-conversation-wrap {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.lead-submission-conversation-body {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: auto;
  flex: 1 1 auto;
  padding: 0 2px calc(14px + env(safe-area-inset-bottom)) 0;
  box-sizing: border-box;
}

.lead-submission-conversation-wrap.has-scroll-hint .lead-submission-conversation-body {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.lead-submission-scroll-hint {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: calc(72px + env(safe-area-inset-bottom));
  padding: 0 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .96) 48%, #fff 100%);
  color: #3978db;
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
  transform: translateY(16px);
}

.lead-submission-scroll-hint[hidden] {
  display: none;
}

.lead-submission-scroll-hint-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #eaf3ff;
  color: #3978db;
  animation: leadConversationHint 1.25s ease-in-out infinite;
}

.lead-submission-scroll-hint-icon svg {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes leadConversationHint {
  0%, 100% { transform: translateY(-1px); }
  50% { transform: translateY(3px); }
}

.lead-submission-chat {
  display: grid;
  gap: 12px;
}

.lead-submission-chat-item {
  display: grid;
  gap: 5px;
  max-width: 86%;
}

.lead-submission-chat-item.outbound {
  justify-self: end;
}

.lead-submission-chat-item > span {
  color: #8592a4;
  font-size: 12px;
}

.lead-submission-chat-item.outbound > span {
  text-align: right;
}

.lead-submission-chat-item p {
  margin: 0;
  border-radius: 12px 12px 12px 3px;
  background: #f1f4f8;
  color: #2d3a4e;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.lead-submission-chat-item.outbound p {
  border-radius: 12px 12px 3px 12px;
  background: #e5f0ff;
  color: #245fae;
}

.lead-submission-image {
  display: block;
  width: auto;
  max-width: min(280px, 100%);
  max-height: 360px;
  border-radius: 12px;
  background: #f1f4f8;
  object-fit: contain;
}

.lead-submission-image-placeholder {
  display: grid;
  min-width: 150px;
  min-height: 72px;
  place-items: center;
  border-radius: 12px;
  background: #f1f4f8;
  color: #8a96a7;
  padding: 12px 16px;
  font-size: 13px;
}

.lead-vehicle-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lead-vehicle-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #edf0f5;
  border-radius: 12px;
  background: #fafbfd;
}

.lead-vehicle-list li.current {
  border-color: #d7e6ff;
  background: #f1f6ff;
}

.lead-vehicle-index {
  display: inline-grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e9eef7;
  color: #66758b;
  font-size: 12px;
  font-weight: 800;
}

.lead-vehicle-list li.current .lead-vehicle-index {
  background: #397be8;
  color: #fff;
}

.lead-vehicle-list strong {
  min-width: 0;
  flex: 1;
  color: #1b2637;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lead-vehicle-list em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 5px;
  background: #dceaff;
  color: #397be8;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.lead-vehicle-empty {
  margin: 0;
  color: #8793a4;
  font-size: 14px;
}

.lead-follow-section {
  padding-bottom: 4px;
}

.lead-follow-section .lead-follow-timeline {
  margin-top: 2px;
}

.lead-follow-section .lead-empty-record {
  min-height: 120px;
}

@media (max-width: 620px) {
  .lead-info-section {
    margin-top: 12px;
    border-radius: 15px;
    padding: 16px;
  }

  .lead-customer-overview {
    display: block;
  }

  .lead-customer-meta {
    grid-template-columns: 1fr 1fr;
    gap: 9px 14px;
  }

  .lead-customer-meta > div {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 7px;
  }

  .lead-detail-section-title {
    margin-bottom: 14px;
  }

  .lead-section-fields {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 12px;
  }

  .lead-remark-grid {
    gap: 14px 12px;
  }

  .lead-section-field,
  .lead-section-field.wide {
    grid-column: auto;
    grid-template-columns: 82px minmax(0, 1fr);
    padding: 8px 0;
  }

  .push-record-card {
    grid-template-columns: 104px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .push-record-card > time {
    font-size: 11px;
  }

  .push-record-status {
    padding: 4px 6px;
    font-size: 11px;
  }
}
