:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --text: #1f2328;
  --muted: #5f6673;
  --line: #d7e0ed;
  --accent: #4579bd;
  --accent-strong: #3f73b8;
  --accent-soft: #eef4fc;
  --brand-yellow: #f6cd00;
  --brand-yellow-strong: #ffd300;
  --brand-yellow-soft: #fff8d7;
  --line-dark: #3f73b8;
  --info: #4579bd;
  --warm: #f6cd00;
  --warm-soft: #fff8d7;
  --danger: #b42318;
  --shadow: 0 12px 28px rgba(31, 64, 104, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft JhengHei", sans-serif;
  letter-spacing: 0;
  line-height: 1.45;
  background:
    radial-gradient(circle at 16px 16px, rgba(246, 205, 0, 0.10) 0 2px, transparent 2px 100%),
    var(--bg);
  background-size: 32px 32px;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

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

button.secondary {
  background: #fff;
  color: var(--accent-strong);
  border: 1px solid var(--line);
}

button.secondary:hover {
  background: var(--accent-soft);
}

.app-header {
  display: block;
  padding: 22px 32px;
  background: linear-gradient(180deg, #ffffff 0%, #fff8d7 100%);
  border-bottom: 1px solid var(--line);
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 34px;
  align-items: center;
  min-height: 560px;
  overflow: hidden;
  padding: 58px max(32px, calc((100vw - 1360px) / 2 + 32px));
  background:
    radial-gradient(circle at 84% 18%, rgba(246, 205, 0, 0.22), transparent 34%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.90) 43%, rgba(63, 115, 184, 0.10) 100%),
    #f7f9fc;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
}

.brand-logo {
  display: block;
  width: min(230px, 48vw);
  height: auto;
  object-fit: contain;
}

.hero-copy h1 {
  max-width: 560px;
  color: #101828;
  font-size: 52px;
  line-height: 1.12;
}

.hero-copy h1 em {
  color: #0646a8;
  font-style: normal;
}

.hero-underline {
  display: block;
  width: 58px;
  height: 5px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--brand-yellow);
}

.hero-copy p {
  max-width: 590px;
  margin-top: 16px;
  color: #455264;
  font-size: 17px;
  line-height: 1.8;
}

.hero-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 28px;
  border: 1px solid rgba(63, 115, 184, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 34px rgba(31, 64, 104, 0.08);
  overflow: hidden;
}

.hero-benefits span {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 86px;
  color: #1b2a41;
  padding: 14px;
}

.hero-benefits span + span {
  border-left: 1px solid rgba(63, 115, 184, 0.14);
}

.hero-benefits b,
.hero-benefits small {
  display: block;
}

.hero-benefits b {
  color: #101828;
  font-size: 15px;
  line-height: 1.25;
}

.hero-benefits small {
  align-self: start;
  color: #536171;
  font-size: 13px;
  font-weight: 700;
}

.benefit-icon {
  position: relative;
  grid-row: 1 / 3;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff7cf;
  color: #0646a8;
}

.benefit-icon.bars::before {
  content: "";
  width: 26px;
  height: 24px;
  background:
    linear-gradient(to top, var(--brand-yellow) 0 58%, transparent 58%) 0 0 / 7px 100% no-repeat,
    linear-gradient(to top, var(--brand-yellow) 0 82%, transparent 82%) 10px 0 / 7px 100% no-repeat,
    linear-gradient(to top, #0646a8 0 100%, transparent 100%) 20px 0 / 7px 100% no-repeat;
}

.benefit-icon.home::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 20px;
  bottom: 9px;
  border-radius: 3px;
  background: #0646a8;
}

.benefit-icon.home::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 22px;
  height: 22px;
  background: var(--brand-yellow);
  transform: rotate(45deg);
  clip-path: polygon(50% 0, 100% 50%, 72% 50%, 72% 100%, 28% 100%, 28% 50%, 0 50%);
}

.benefit-icon.bank::before {
  content: "";
  width: 28px;
  height: 25px;
  background:
    linear-gradient(135deg, transparent 0 45%, #0646a8 45% 55%, transparent 55%) 0 0 / 100% 10px no-repeat,
    linear-gradient(90deg, #0646a8 0 5px, transparent 5px 9px, #0646a8 9px 14px, transparent 14px 18px, #0646a8 18px 23px, transparent 23px) 2px 11px / 26px 11px no-repeat,
    linear-gradient(#0646a8, #0646a8) 0 23px / 28px 2px no-repeat;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-actions button {
  min-height: 48px;
  padding: 0 20px;
  box-shadow: 0 12px 24px rgba(63, 115, 184, 0.22);
}

.hero-actions button.secondary {
  background: #fff;
  color: var(--accent-strong);
  box-shadow: none;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(63, 115, 184, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
  max-width: 610px;
}

.hero-proof div {
  border: 1px solid rgba(63, 115, 184, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.hero-proof strong,
.hero-proof span {
  display: block;
}

.hero-proof strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.hero-proof span {
  margin-top: 4px;
  color: #455264;
  font-size: 13px;
  font-weight: 700;
}

.hero-step-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 22px;
  border: 1px solid rgba(63, 115, 184, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 34px rgba(31, 64, 104, 0.08);
  overflow: hidden;
}

.hero-step-strip button {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 78px;
  border-radius: 0;
  background: transparent;
  color: #101828;
  padding: 12px 18px;
  text-align: left;
  box-shadow: none;
}

.hero-step-strip button:hover {
  background: var(--accent-soft);
}

.hero-step-strip button + button {
  border-left: 1px solid rgba(63, 115, 184, 0.14);
}

.hero-step-strip button:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-top: 2px solid #0646a8;
  border-right: 2px solid #0646a8;
  transform: translateY(-50%) rotate(45deg);
}

.hero-step-strip strong,
.hero-step-strip small {
  display: block;
}

.hero-step-strip strong {
  color: #0646a8;
  font-size: 16px;
}

.hero-step-strip small {
  margin-top: 3px;
  color: #455264;
  font-size: 13px;
}

.step-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #edf4ff;
}

.step-icon.pin::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  background: #0646a8;
  transform: rotate(-45deg);
}

.step-icon.pin::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.step-icon.calc::before {
  content: "";
  width: 22px;
  height: 28px;
  border: 3px solid #0646a8;
  border-radius: 4px;
  background:
    linear-gradient(#0646a8, #0646a8) 5px 8px / 12px 2px no-repeat,
    radial-gradient(circle, var(--brand-yellow) 0 3px, transparent 4px) 4px 15px / 8px 8px no-repeat,
    radial-gradient(circle, #0646a8 0 3px, transparent 4px) 14px 15px / 8px 8px no-repeat;
}

.step-icon.chart::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(#0646a8 0 72%, var(--brand-yellow) 72% 100%);
}

.step-icon.chart::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #edf4ff;
}

.hero-visual {
  position: relative;
  min-height: 450px;
}

.hero-visual img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(63, 115, 184, 0.18);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(31, 64, 104, 0.20);
}

.hero-result-card {
  position: absolute;
  max-width: 330px;
  border: 1px solid rgba(216, 226, 240, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  box-shadow: 0 16px 36px rgba(31, 64, 104, 0.18);
  backdrop-filter: blur(12px);
}

.hero-result-card.main {
  left: 22px;
  bottom: 22px;
}

.hero-result-card.mini {
  right: 22px;
  top: 22px;
  border-top: 4px solid var(--brand-yellow);
}

.hero-result-card span {
  display: block;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.hero-result-card strong {
  display: block;
  margin-top: 5px;
  color: #101828;
  font-size: 18px;
}

.hero-result-card p {
  margin-top: 6px;
  color: #526071;
  font-size: 13px;
}

.title-block {
  max-width: 1360px;
  margin: 0 auto;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  font-size: 28px;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.data-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.data-badges span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--brand-yellow-soft);
  padding: 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  white-space: nowrap;
}

.workspace {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 32px 44px;
}

.sales-intro {
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  margin: 0 -32px 18px;
  border-top: 1px solid rgba(63, 115, 184, 0.14);
  border-bottom: 1px solid rgba(63, 115, 184, 0.14);
  background: linear-gradient(90deg, #ffffff 0%, #f9fbff 64%, #fff8d7 100%);
  padding: 42px 64px;
}

.sales-intro-copy {
  position: relative;
  display: grid;
  align-content: center;
  padding-left: 76px;
}

.sales-intro-copy::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 58px;
  border-radius: 28px 28px 10px 28px;
  background: linear-gradient(180deg, #0646a8 0 58%, var(--brand-yellow) 58% 100%);
  box-shadow: 0 18px 34px rgba(31, 64, 104, 0.16);
}

.sales-intro-copy h2 {
  max-width: 560px;
  color: #101828;
  font-size: 34px;
  line-height: 1.24;
}

.sales-intro-copy p {
  max-width: 660px;
  margin-top: 12px;
  color: #455264;
  font-size: 15px;
  line-height: 1.8;
}

.sales-intro-copy button {
  justify-self: start;
  margin-top: 18px;
  min-height: 46px;
  padding: 0 18px;
  box-shadow: 0 12px 24px rgba(63, 115, 184, 0.18);
}

.sales-intro-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(63, 115, 184, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 34px rgba(31, 64, 104, 0.08);
  overflow: hidden;
}

.sales-intro-cards article {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 250px;
  border: 0;
  background: transparent;
  padding: 28px 22px 22px;
}

.sales-intro-cards article + article {
  border-left: 1px solid rgba(63, 115, 184, 0.14);
}

.sales-card-no {
  position: absolute;
  left: 20px;
  top: 18px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0646a8;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.sales-card-no.yellow {
  background: var(--brand-yellow);
  color: #0646a8;
}

.sales-card-icon {
  position: relative;
  justify-self: center;
  width: 68px;
  height: 68px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: #edf4ff;
}

.sales-card-icon.search-home::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 12px;
  width: 28px;
  height: 28px;
  border: 4px solid #0646a8;
  border-radius: 50%;
}

.sales-card-icon.search-home::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 15px;
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: #0646a8;
  transform: rotate(45deg);
  box-shadow: -16px -17px 0 -7px var(--brand-yellow);
}

.sales-card-icon.building-pin::before {
  content: "";
  position: absolute;
  left: 13px;
  bottom: 12px;
  width: 24px;
  height: 38px;
  border: 4px solid #0646a8;
  border-radius: 5px;
  background:
    linear-gradient(#0646a8, #0646a8) 5px 9px / 5px 5px no-repeat,
    linear-gradient(#0646a8, #0646a8) 14px 9px / 5px 5px no-repeat,
    linear-gradient(#0646a8, #0646a8) 5px 20px / 5px 5px no-repeat,
    linear-gradient(#0646a8, #0646a8) 14px 20px / 5px 5px no-repeat;
}

.sales-card-icon.building-pin::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 18px;
  width: 19px;
  height: 19px;
  border-radius: 50% 50% 50% 0;
  background: var(--brand-yellow);
  transform: rotate(-45deg);
}

.sales-card-icon.folder-check::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 18px;
  width: 44px;
  height: 33px;
  border: 4px solid #0646a8;
  border-radius: 6px;
  background: #fff;
}

.sales-card-icon.folder-check::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 0 42%, #fff 42% 58%, transparent 58%) 7px 7px / 11px 8px no-repeat,
    var(--brand-yellow);
}

.sales-intro-cards strong {
  display: block;
  color: #0646a8;
  font-size: 13px;
  text-align: center;
}

.sales-intro-cards h3 {
  margin-top: 10px;
  color: #101828;
  font-size: 20px;
  line-height: 1.35;
  text-align: center;
}

.sales-intro-cards p {
  margin-top: 10px;
  color: #5b6675;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.sales-intro-cards em {
  display: block;
  align-self: end;
  min-height: 46px;
  margin-top: 18px;
  border-radius: 10px;
  background: linear-gradient(90deg, #edf4ff, #fff8d7);
  color: #0646a8;
  padding: 10px 12px;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 -32px 20px;
  border-bottom: 1px solid rgba(63, 115, 184, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.trust-strip article {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 20px 34px;
}

.trust-strip article + article {
  border-left: 1px solid rgba(63, 115, 184, 0.14);
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip strong {
  color: #101828;
  font-size: 16px;
}

.trust-strip span {
  align-self: start;
  color: #5b6675;
  font-size: 13px;
}

.trust-icon {
  position: relative;
  grid-row: 1 / 3;
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: #edf4ff;
}

.trust-icon.shield::before {
  content: "";
  width: 28px;
  height: 32px;
  background: #0646a8;
  clip-path: polygon(50% 0, 92% 18%, 82% 72%, 50% 100%, 18% 72%, 8% 18%);
}

.trust-icon.shield::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 7px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg);
}

.trust-icon.lock::before {
  content: "";
  width: 28px;
  height: 23px;
  margin-top: 8px;
  border-radius: 5px;
  background: #0646a8;
}

.trust-icon.lock::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 18px;
  height: 17px;
  border: 4px solid #0646a8;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.trust-icon.handshake::before {
  content: "";
  width: 30px;
  height: 16px;
  border-radius: 5px;
  border: 4px solid #0646a8;
  transform: rotate(-8deg);
}

.trust-icon.handshake::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand-yellow);
  transform: rotate(18deg);
}

.trust-icon.headset::before {
  content: "";
  width: 30px;
  height: 26px;
  border: 4px solid #0646a8;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.trust-icon.headset::after {
  content: "";
  position: absolute;
  bottom: 13px;
  right: 8px;
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand-yellow);
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.chat-panel,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto auto;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #eef8ef 100%);
}

.chat-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.chat-panel-head h2 {
  font-size: 22px;
}

.chat-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #06c755;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.intake-progress {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  border: 1px solid #ccebd2;
  border-radius: 12px;
  background: #f7fff8;
  padding: 10px 12px;
}

.intake-progress-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.intake-progress-title strong {
  color: #0f7b38;
  font-size: 13px;
}

.intake-progress-title span {
  color: #3f73b8;
  font-size: 12px;
  font-weight: 800;
}

.intake-progress-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.intake-progress-list span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  border: 1px solid #dce6f3;
  border-radius: 999px;
  background: #fff;
  color: #5f6673;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.intake-progress-list span.ready {
  border-color: rgba(6, 199, 85, 0.45);
  background: #ecfff1;
  color: #0f7b38;
  font-weight: 800;
}
.query-progress,
.query-result-notice {
  border: 1px solid #cbdcf3;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  box-shadow: 0 10px 24px rgba(31, 64, 104, 0.08);
  padding: 12px 14px;
}

.query-progress[hidden],
.query-result-notice[hidden] {
  display: none;
}

.query-progress {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.query-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.query-progress-head strong {
  color: #0b3670;
  font-size: 15px;
}

.query-progress-head span {
  color: #3f73b8;
  font-size: 13px;
  font-weight: 900;
}

.query-progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9f7;
}

.query-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f6cd00 0%, #ffd300 34%, #3f73b8 100%);
  transition: width .42s ease;
}

.query-progress p {
  margin: 0;
  color: #40516a;
  font-size: 14px;
  line-height: 1.55;
}

.query-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.query-progress-steps li {
  min-height: 34px;
  border: 1px solid #d8e4f4;
  border-radius: 999px;
  background: #fff;
  color: #607086;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.query-progress-steps li.is-active {
  border-color: #3f73b8;
  background: #edf5ff;
  color: #0b3670;
}

.query-progress-steps li.is-done,
.query-progress.is-complete .query-progress-steps li {
  border-color: rgba(6, 199, 85, 0.36);
  background: #edfff2;
  color: #0f7b38;
}

.query-progress.is-error {
  border-color: #f0c0b8;
  background: #fff7f5;
}

.query-progress.is-error .query-progress-bar span {
  background: linear-gradient(90deg, #d44832, #f2a192);
}

.query-result-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  border-color: rgba(6, 199, 85, 0.35);
  background: #f3fff6;
}

.query-result-notice strong {
  display: block;
  color: #0f7b38;
  font-size: 15px;
}

.query-result-notice p {
  margin: 3px 0 0;
  color: #40516a;
  line-height: 1.55;
}

.query-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.query-result-actions button {
  min-height: 38px;
  border: 1px solid #3f73b8;
  border-radius: 999px;
  background: #3f73b8;
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.query-result-actions button:hover {
  background: #0b3670;
}
.chat-messages {
  display: grid;
  gap: 12px;
  min-height: 560px;
  max-height: min(720px, 72vh);
  overflow-y: auto;
  padding-right: 4px;
  background: #eef7ed;
  border: 1px solid #d8ecd6;
  border-radius: 12px;
  padding: 14px;
}

.chat-messages:empty {
  display: none;
}

.message {
  max-width: 880px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid transparent;
  box-shadow: 0 6px 16px rgba(31, 64, 104, 0.10);
}

.message strong {
  display: block;
  margin-bottom: 4px;
}

.message.user {
  justify-self: end;
  background: #06c755;
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 18px rgba(6, 199, 85, 0.20);
}

.message.user p {
  color: #fff;
}

.message.assistant {
  justify-self: start;
  background: #fff;
  border-color: #d7ead5;
  border-bottom-left-radius: 6px;
}

.advisor-message {
  max-width: 940px;
  border-color: rgba(6, 199, 85, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f7fff8 100%);
}

.advisor-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.advisor-options button {
  display: grid;
  gap: 5px;
  min-height: 86px;
  border: 2px solid #bde8c7;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 14px;
  text-align: left;
  box-shadow: 0 6px 16px rgba(31, 64, 104, 0.06);
}

.advisor-options button:hover {
  background: #f3fff5;
  border-color: #06c755;
  color: var(--text);
  transform: translateY(-1px);
}

.advisor-options button strong {
  display: block;
  margin: 0;
  color: #101828;
  font-size: 15px;
}

.advisor-options button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.advisor-intake-summary {
  border: 1px solid rgba(6, 199, 85, 0.26);
  border-left: 4px solid #06c755;
  border-radius: 8px;
  background: #f3fff5;
  padding: 12px;
}

.advisor-intake-summary strong {
  display: block;
  color: var(--accent-strong);
  font-size: 13px;
}

.advisor-intake-summary p {
  margin-top: 5px;
  color: #455264;
  font-size: 13px;
}

.proactive-message {
  border-left: 4px solid #06c755;
}

.proactive-options button {
  border-color: rgba(6, 199, 85, 0.42);
}

.proactive-options button:first-child {
  background: linear-gradient(180deg, #f2fff5 0%, #ffffff 100%);
}

.advisor-intro-form {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(120px, 0.7fr);
  gap: 10px;
  margin-top: 12px;
}

.advisor-intro-form label {
  display: grid;
  gap: 6px;
}

.advisor-intro-form label span {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.advisor-intro-form button {
  grid-column: 1 / -1;
  background: #06c755;
  min-height: 44px;
}

.advisor-intro-form button:hover {
  background: #05a847;
}

.message-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.rich-card {
  overflow: hidden;
  border: 1px solid #d7e0ed;
  border-radius: 14px;
  background: #fff;
}

.rich-card-button {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(20, 42, 78, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.rich-card-button:hover,
.rich-card-button:focus-visible {
  border-color: #4579bd;
  background: #fff;
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(63, 115, 184, 0.16);
  outline: none;
}

.rich-card-visual {
  min-height: 86px;
  position: relative;
  background: linear-gradient(135deg, #4579bd 0%, #3f73b8 100%);
}

.rich-card-visual::before,
.rich-card-visual::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.rich-card-visual::before {
  width: 84px;
  height: 84px;
  right: 18px;
  top: -18px;
}

.rich-card-visual::after {
  width: 48px;
  height: 48px;
  left: 18px;
  bottom: 14px;
}

.rich-card-visual.market {
  background: linear-gradient(135deg, #4579bd 0%, #3f73b8 55%, #f6cd00 100%);
}

.rich-card-visual.evidence {
  background: linear-gradient(135deg, #3f73b8 0%, #5d8dcc 50%, #4579bd 100%);
}

.rich-card-visual.loan {
  background: linear-gradient(135deg, #4579bd 0%, #ffd300 100%);
}

.rich-card-body {
  padding: 12px;
}

.rich-card-body span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rich-card-body strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.rich-card-body p {
  margin-top: 5px;
  font-size: 12px;
}

.rich-card-body small {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  color: #3f73b8;
  font-size: 12px;
  font-weight: 800;
}

.rich-card-body small::after {
  content: ">";
  margin-left: 6px;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  margin-top: 16px;
}

textarea {
  width: 100%;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font: inherit;
  resize: vertical;
  background: #fff;
}

textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.prompt-chips,
.followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.prompt-chips button,
.followups button {
  min-height: 34px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
}

.prompt-chips button:hover,
.followups button:hover {
  background: var(--accent);
  color: #fff;
}

.prompt-chips button.loan-chip {
  background: var(--brand-yellow-soft);
  border-color: var(--brand-yellow);
  color: var(--accent-strong);
}

.prompt-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.prompt-cards button {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 96px;
  border-radius: 8px;
  padding: 13px;
  text-align: left;
  background: #fff;
  border-color: #d8e3f2;
  box-shadow: 0 6px 16px rgba(31, 64, 104, 0.06);
}

.prompt-cards button::before {
  content: "";
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand-yellow);
}

.prompt-cards button strong {
  display: block;
  color: #101828;
  font-size: 14px;
  line-height: 1.35;
}

.prompt-cards button span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.prompt-cards button:hover {
  transform: translateY(-1px);
  background: #f7fbff;
  color: inherit;
  border-color: var(--accent);
}

.prompt-cards button:hover strong {
  color: var(--accent-strong);
}

.prompt-cards button.loan-chip {
  background: linear-gradient(180deg, #fffbe8 0%, #ffffff 100%);
  border-color: var(--brand-yellow);
}

.chat-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid rgba(63, 115, 184, 0.14);
  padding-top: 14px;
}

.chat-cta-row button {
  flex: 1 1 240px;
  min-height: 42px;
  background: var(--accent);
}

.chat-cta-row button:hover {
  background: var(--accent-strong);
}

.chat-cta-row button.secondary {
  background: #fff;
  color: var(--accent-strong);
  border-color: var(--accent);
}

.lead-form .full-field {
  grid-column: 1 / -1;
}

.lead-form select,
.lead-form textarea,
.lead-form input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.lead-form textarea {
  min-height: 86px;
  resize: vertical;
}

.document-checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.document-checklist legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 0 4px;
}

.lead-form .document-checklist label,
.document-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.lead-form .document-checklist input,
.document-checklist input {
  width: auto;
  min-height: auto;
  flex: 0 0 auto;
  margin: 0;
}

.note-choice {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: stretch;
}

.note-choice label {
  display: grid;
  grid-template-rows: 20px 1fr;
  gap: 6px;
  min-width: 0;
}

.note-choice select,
.note-choice textarea {
  min-height: 86px;
}

.note-choice select {
  align-self: stretch;
  padding-top: 0;
  padding-bottom: 0;
}

.retention-box {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid #f0d85c;
  border-radius: 8px;
  background: var(--brand-yellow-soft);
  padding: 12px;
}

.retention-box span {
  color: #455264;
  font-size: 13px;
}

.answer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
}

.case-lookup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 14px;
  align-items: start;
  margin-top: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.case-lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.case-lookup-result {
  grid-column: 1 / -1;
}

.case-result-card,
.case-ticket {
  border: 1px solid #b8cbe4;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.case-result-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.case-result-card span,
.case-ticket span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.case-result-card strong,
.case-ticket strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.case-result-card p {
  grid-column: 1 / -1;
  margin-top: 0;
}

.document-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  padding: 12px;
}

.document-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e8edf5;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--brand-yellow) 100%);
}

.document-progress ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-progress li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.document-progress li.ready {
  border-color: #f0d85c;
  background: var(--brand-yellow-soft);
  color: var(--text);
}

.case-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.case-actions strong {
  flex-basis: 100%;
  color: var(--text);
}

.case-actions button {
  min-height: 36px;
  background: var(--accent);
}

.case-actions p {
  flex-basis: 100%;
  margin-top: 0;
  color: var(--accent-strong);
  font-weight: 700;
}

.case-error {
  color: var(--danger);
  font-weight: 700;
}

.case-ticket {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  background: var(--brand-yellow-soft);
  border-color: #f0d85c;
}

.panel {
  padding: 18px;
}

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

.answer-panel {
  min-height: 240px;
}

.market-dashboard {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

.kpi-card {
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  padding: 13px;
}

.kpi-card span,
.chart-head span,
.bar-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin: 10px 0 4px;
  color: var(--accent-strong);
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-card small {
  color: var(--muted);
  font-size: 12px;
}

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

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

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

.chart-head strong {
  font-size: 14px;
}

.range-track,
.bar-track {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.range-track {
  height: 14px;
}

.range-fill,
.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #3f73b8 72%, #f6cd00 100%);
}

.range-track i {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 22px;
  border-radius: 3px;
  background: var(--brand-yellow);
  transform: translateX(-50%);
}

.range-labels,
.trend-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.range-labels strong,
.trend-labels strong {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.chart-card p {
  margin-top: 9px;
  font-size: 12px;
}

.sparkline {
  display: block;
  width: 100%;
  height: 96px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.sparkline polyline {
  fill: none;
  stroke: var(--info);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

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

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.bar-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 10px;
}

.answer-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.answer-list li {
  line-height: 1.6;
  padding-right: 8px;
}

.comparison-list,
.area-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.comparison-card,
.area-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.comparison-card {
  border-left: 4px solid var(--info);
}

.area-card {
  border-left: 4px solid var(--accent);
}

.comparison-card strong,
.area-card strong {
  display: block;
  margin-bottom: 8px;
}

.comparison-card span,
.area-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.caveat-list {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.loan-gate-slot {
  margin-top: 14px;
}

.lead-gate {
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(180deg, #eef4fc 0%, #ffffff 100%);
  padding: 16px;
  box-shadow: 0 12px 28px rgba(69, 121, 189, 0.14);
}

.lead-gate.unlocked {
  background: #f9fbff;
  border-color: #b8cbe4;
}

.lead-gate h3 {
  color: var(--accent-strong);
  font-size: 22px;
  margin-bottom: 6px;
}

.lead-gate ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.lead-gate li {
  line-height: 1.55;
}

.loan-result-amount {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  border: 1px solid #b8cbe4;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.loan-result-amount span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.loan-result-amount strong {
  color: var(--accent-strong);
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.loan-result-amount small {
  color: var(--muted);
  line-height: 1.45;
}

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

.lead-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.email-verify-panel {
  grid-column: 1 / -1;
  border: 1px solid #b8cbe4;
  border-radius: 8px;
  background: #f9fbff;
  padding: 10px;
}

.email-verify-actions {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.email-verify-actions input {
  min-height: 40px;
}

.email-verify-actions button,
.email-verify-actions button.secondary {
  color: #fff;
}

.email-verify-status {
  margin-top: 8px;
  color: #3f73b8;
  font-size: 12px;
  font-weight: 700;
}

.email-verify-status.ok {
  color: var(--accent-strong);
}

.firebase-recaptcha {
  min-height: 0;
}

.lead-form button {
  align-self: end;
  background: var(--accent);
  min-height: 46px;
}

.lead-form button:hover {
  background: var(--accent-strong);
}

.lead-status {
  align-self: center;
  margin-top: 0;
  font-size: 12px;
}

.loan-assessment-intake {
  display: grid;
  gap: 14px;
  border: 1px solid #b8cbe4;
  border-top: 4px solid var(--brand-yellow, #f6cd00);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.loan-assessment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.loan-assessment-head > div > span,
.lead-contact-intro span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.loan-assessment-head h4 {
  margin: 3px 0 4px;
  color: var(--text);
  font-size: 20px;
}

.loan-assessment-head p {
  color: var(--muted);
  font-size: 13px;
}

.assessment-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff7cc;
  color: #735f00;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.loan-assessment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.loan-assessment-fields label small {
  min-height: 18px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.lead-form .loan-preview-button {
  min-height: 46px;
  border-color: #d5b000;
  background: var(--brand-yellow, #f6cd00);
  color: #12223d;
}

.lead-form .loan-preview-button:hover {
  background: #ffd930;
}

.lead-form .loan-preview-button.is-running,
.lead-form .loan-preview-button.is-running:hover {
  position: relative;
  overflow: hidden;
  border-color: #2f64aa;
  background: #3f73b8;
  color: #fff;
  cursor: wait;
}

.lead-form .loan-preview-button.is-running::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #f6cd00, #fff2a6);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  animation: loan-button-progress 8s linear forwards;
}

.loan-score-preview:not(:empty) {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border-radius: 8px;
  background: #f3f7fd;
  padding: 14px;
}

.loan-score-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: #8a5700;
  font-size: 13px;
  font-weight: 700;
}

.loan-score-running {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  width: 100%;
}

.loan-running-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.loan-running-head div {
  display: grid;
  gap: 2px;
}

.loan-running-head strong {
  color: var(--text);
  font-size: 15px;
}

.loan-running-head small,
.loan-score-running > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.loan-running-head b {
  color: var(--accent-strong);
  font-size: 13px;
  white-space: nowrap;
}

.loan-running-spinner {
  width: 34px;
  aspect-ratio: 1;
  border: 4px solid #d6e3f5;
  border-top-color: var(--brand-yellow, #f6cd00);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: loan-score-spin 0.85s linear infinite;
}

.loan-running-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #dfe8f4;
}

.loan-running-progress span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3f73b8, #f6cd00);
  transition: width 0.85s ease;
}

.loan-running-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.loan-running-steps li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  border: 1px solid #d9e3f0;
  border-radius: 6px;
  background: #fff;
  padding: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.loan-running-steps i {
  display: grid;
  place-items: center;
  width: 24px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #edf3fb;
  color: var(--accent-strong);
  font-style: normal;
}

.loan-running-steps li.is-active {
  border-color: #8fb1df;
  background: #edf4fd;
  color: var(--text);
  box-shadow: inset 0 -3px 0 var(--brand-yellow, #f6cd00);
}

.loan-running-steps li.is-active i {
  background: var(--accent);
  color: #fff;
  animation: loan-step-pulse 1s ease-in-out infinite;
}

.loan-running-steps li.is-done {
  border-color: #b8d7c4;
  color: #255f3f;
}

.loan-running-steps li.is-done i {
  background: #2d7a50;
  color: #fff;
  font-size: 0;
}

.loan-running-steps li.is-done i::before {
  content: "✓";
  font-size: 13px;
}

.loan-score-ring {
  display: grid;
  place-content: center;
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 59%, transparent 60%),
    conic-gradient(var(--accent) calc(var(--score) * 1%), #dfe8f4 0);
  text-align: center;
}

.loan-score-ring.is-revealed {
  animation: loan-score-reveal 0.55s ease-out both;
}

@keyframes loan-button-progress {
  to { transform: scaleX(1); }
}

@keyframes loan-score-spin {
  to { transform: rotate(360deg); }
}

@keyframes loan-step-pulse {
  50% { transform: scale(1.08); }
}

@keyframes loan-score-reveal {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}

.loan-score-ring strong {
  color: var(--accent-strong);
  font-size: 28px;
  line-height: 1;
}

.loan-score-ring span,
.loan-score-ring small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.loan-score-content {
  display: grid;
  gap: 5px;
}

.loan-score-content > strong {
  color: var(--text);
  font-size: 17px;
}

.loan-score-content p,
.loan-score-content > small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.loan-score-content dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 5px 0;
}

.loan-score-content dl div {
  border-left: 3px solid var(--brand-yellow, #f6cd00);
  background: #fff;
  padding: 8px 10px;
}

.loan-score-content dt {
  color: var(--muted);
  font-size: 11px;
}

.loan-score-content dd {
  margin: 2px 0 0;
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 800;
}

.lead-contact-intro {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.lead-contact-intro strong {
  color: var(--text);
  font-size: 17px;
}

.unlocked-assessment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  margin: 12px 0;
  border-left: 5px solid var(--brand-yellow, #f6cd00);
  background: #fff;
  padding: 12px 14px;
}

.unlocked-assessment > span,
.unlocked-assessment > small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.unlocked-assessment > strong {
  grid-row: 1 / span 3;
  color: var(--accent-strong);
  font-size: 28px;
}

.unlocked-assessment > strong small {
  font-size: 12px;
}

.unlocked-assessment p {
  grid-column: 2;
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 720px) {
  .loan-assessment-intake {
    padding: 13px;
  }

  .loan-assessment-head,
  .loan-score-preview:not(:empty) {
    grid-template-columns: 1fr;
  }

  .loan-assessment-head {
    display: grid;
  }

  .assessment-badge {
    justify-self: start;
  }

  .loan-assessment-fields,
  .loan-score-content dl {
    grid-template-columns: 1fr;
  }

  .loan-score-preview:not(:empty) {
    justify-items: stretch;
  }

  .loan-score-ring {
    width: 92px;
  }

  .loan-running-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-form .loan-preview-button.is-running::after,
  .loan-running-spinner,
  .loan-running-steps li.is-active i,
  .loan-score-ring.is-revealed {
    animation: none;
  }
}

.caveat-list p {
  color: var(--muted);
  font-size: 13px;
}

.side-panel {
  align-self: start;
  position: sticky;
  top: 14px;
}

.evidence-panel {
  margin-top: 18px;
}

.section-focus {
  animation: sectionFocus 1.4s ease;
}

@keyframes sectionFocus {
  0% {
    box-shadow: 0 0 0 0 rgba(246, 205, 0, 0.74);
  }
  45% {
    box-shadow: 0 0 0 8px rgba(246, 205, 0, 0.22);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(246, 205, 0, 0);
  }
}

.case-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.case-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.case-tools select {
  width: 82px;
}

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

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

.evidence-row {
  display: grid;
  grid-template-columns: 100px minmax(240px, 1.25fr) minmax(560px, 2.15fr) 170px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.evidence-row:hover {
  border-color: rgba(63, 115, 184, 0.38);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.evidence-date,
.evidence-address,
.evidence-detail {
  min-width: 0;
}

.evidence-date {
  display: grid;
  gap: 4px;
}

.evidence-date strong {
  color: var(--text);
  font-size: 15px;
}

.evidence-date span,
.evidence-address strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.evidence-date span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.evidence-address {
  display: grid;
  gap: 8px;
}

.evidence-address strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.evidence-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.evidence-tags em {
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 8px;
}

.evidence-tags .is-strong {
  background: #e9f8ef;
  color: #087443;
}

.evidence-tags .is-medium {
  background: #fff4cc;
  color: #8a5a00;
}

.evidence-tags .is-light {
  background: #f2f4f7;
  color: #475467;
}

.evidence-metrics {
  display: grid;
  grid-template-columns: minmax(72px, 0.85fr) minmax(92px, 1fr) minmax(72px, 0.8fr) minmax(72px, 0.8fr) minmax(132px, 1.35fr) minmax(72px, 0.8fr);
  gap: 8px;
  min-width: 0;
}

.evidence-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.evidence-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.evidence-metrics strong {
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.evidence-metrics .metric-floor strong {
  white-space: normal;
  word-break: keep-all;
}

.evidence-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.evidence-actions button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.evidence-detail {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.evidence-analysis {
  grid-column: 1 / -1;
  border: 1px solid rgba(63, 115, 184, 0.18);
  border-left: 5px solid var(--blue);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  padding: 14px 16px;
}

.evidence-analysis h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 16px;
}

.evidence-analysis ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.evidence-analysis li {
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(220px, 1.4fr) minmax(160px, 1fr);
  gap: 10px;
}

.analysis-grid span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.analysis-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analysis-grid strong {
  color: var(--blue);
  font-size: 14px;
  line-height: 1.45;
}

.evidence-detail dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.evidence-detail div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.evidence-detail dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.evidence-detail dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.empty-evidence {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  padding: 18px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7f6;
  color: var(--muted);
  font-weight: 700;
}

tbody tr:hover {
  background: #f9fbfc;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.admin-body {
  background: var(--bg);
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.admin-header > div {
  max-width: 880px;
}

.admin-header p {
  max-width: 760px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.admin-link:hover {
  background: var(--accent-soft);
}

.admin-locked .admin-header,
.admin-locked .admin-sidebar {
  display: none;
}

.admin-locked .admin-shell {
  display: block;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 16% 16%, rgba(246, 205, 0, .18), transparent 28%),
    linear-gradient(135deg, #f7fbff 0%, #ffffff 48%, #fff7cc 100%);
}

.admin-locked .admin-workspace {
  min-height: 100vh;
}

.admin-locked #leadPanel,
.admin-locked #modulePanel {
  display: none !important;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 32px 44px;
}

.admin-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.admin-sidebar strong {
  color: var(--accent-strong);
  font-size: 14px;
}

.admin-sidebar button {
  justify-content: start;
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.admin-sidebar button.active,
.admin-sidebar button:hover {
  border-color: #c7d8ee;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.admin-sidebar hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

.admin-workspace {
  min-width: 0;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.admin-login {
  max-width: 560px;
  margin: 48px auto 0;
}

.admin-login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.admin-login-card {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(280px, .78fr);
  width: min(1120px, 100%);
  overflow: hidden;
  border: 1px solid #d6e2f2;
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 80px rgba(31, 41, 55, .16);
}

.admin-login-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 560px;
  padding: clamp(30px, 5vw, 64px);
}

.admin-login-kicker {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
}

.admin-login-copy h1 {
  max-width: 680px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.18;
}

.admin-login-copy h2 {
  margin-top: 6px;
  color: #1f2937;
  font-size: 22px;
}

.admin-login-copy p {
  max-width: 560px;
  color: #516176;
  line-height: 1.8;
}

.admin-login-status {
  min-height: 24px;
  font-size: 14px;
}

.admin-login-status.needs-browser {
  display: grid;
  gap: 10px;
  max-width: 520px;
  min-height: auto;
  margin-top: 2px;
  border: 1px solid #f6cd00;
  border-radius: 12px;
  background: #fffbea;
  color: #102033;
  padding: 14px;
  line-height: 1.65;
}

.admin-login-status.needs-browser strong {
  display: block;
  color: #0b3670;
  font-size: 15px;
}

.admin-login-status.needs-browser span {
  display: block;
  color: #40516a;
}

.admin-login-status.needs-browser input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bdd0ea;
  border-radius: 10px;
  background: #fff;
  color: #102033;
  padding: 0 12px;
  font: inherit;
}

.admin-login-status.needs-browser button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: #3f73b8;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.admin-google-login.is-disabled {
  border-color: #b8c7dc;
  background: #f7f9fc;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.admin-google-login.is-disabled:hover {
  border-color: #b8c7dc;
  background: #f7f9fc;
  color: #64748b;
  transform: none;
}
.admin-login-visual {
  position: relative;
  min-height: 560px;
  background: linear-gradient(135deg, #fffef4, #eef5ff);
}

.admin-login-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-login h2 {
  font-size: 22px;
}

.admin-google-login {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  min-height: 56px;
  margin-top: 10px;
  border: 2px solid #3f73b8;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(69, 121, 189, .18);
}

.admin-google-login:hover {
  border-color: #2f66ad;
  background: #f7fbff;
  color: #1f2937;
  transform: translateY(-1px);
}

.google-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #edf4ff);
  color: #3f73b8;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px #d7e3f4;
}

@media (max-width: 860px) {
  .admin-login-screen {
    padding: 18px;
  }

  .admin-login-card {
    grid-template-columns: 1fr;
  }

  .admin-login-copy {
    min-height: auto;
    padding: 28px;
  }


  .admin-login-visual {
    min-height: 220px;
    order: -1;
  }

  .admin-google-login {
    max-width: none;
  }
}

.admin-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-login-divider::before,
.admin-login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.admin-login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.admin-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.admin-toolbar h2 {
  font-size: 22px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.admin-actions input {
  width: min(360px, 48vw);
}

.admin-lead-controls,
.admin-bulk-bar,
.admin-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.admin-lead-controls label {
  display: grid;
  gap: 5px;
  min-width: 132px;
}

.admin-lead-controls label:nth-child(3),
.admin-lead-controls label:nth-child(5) {
  min-width: 190px;
}

.admin-lead-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-lead-controls input,
.admin-lead-controls select,
.admin-bulk-bar input,
.admin-bulk-bar select {
  min-height: 38px;
}

.admin-bulk-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fffaf0;
}

.admin-check-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.admin-check-all input,
.select-cell input {
  width: 16px;
  height: 16px;
}

#selectedLeadCount {
  color: var(--accent-strong);
  font-size: 13px;
}

.admin-pager {
  justify-content: end;
  margin-top: 12px;
  margin-bottom: 0;
}

.admin-pager span {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

#leadTable thead {
  display: none;
}

#leadTable,
#leadTable tbody,
#leadTable tr,
#leadTable td {
  display: block;
  width: 100%;
}

.lead-list-tr > td {
  padding: 5px 0;
  border-bottom: 0;
}

.lead-modal-row > td {
  padding: 0;
  border-bottom: 0;
}

.lead-case-row {
  display: grid;
  grid-template-columns: 26px minmax(170px, 0.9fr) minmax(260px, 1.5fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) minmax(92px, 0.42fr) 66px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.lead-case-row > * {
  min-width: 0;
}

.lead-case-check {
  display: grid;
  place-items: center;
}

.lead-case-check input {
  width: 16px;
  height: 16px;
}

.lead-case-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.lead-case-main:hover,
.lead-case-main:focus-visible {
  background: transparent;
  color: var(--blue);
  outline: none;
}

.lead-case-id,
.lead-case-main span,
.lead-case-need span,
.lead-case-meta span,
.lead-case-docs span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-case-main strong,
.lead-case-need strong,
.lead-case-meta strong,
.lead-case-docs strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-case-need,
.lead-case-meta,
.lead-case-docs {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lead-case-need span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-case-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.lead-case-badges em {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-case-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.lead-case-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.lead-case-modal {
  width: min(1060px, calc(100vw - 32px));
}

.lead-modal-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 16px;
}

.lead-modal-sections article {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.lead-modal-sections h4 {
  margin: 0;
}

.lead-modal-sections .admin-file-list,
.lead-modal-sections .admin-log-list {
  max-height: 180px;
  overflow: auto;
}

.select-cell {
  width: 42px;
  text-align: center;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  padding: 12px;
}

.admin-summary span,
.admin-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-summary strong {
  display: block;
  margin: 6px 0;
  color: var(--accent-strong);
  font-size: 24px;
}

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

.analytics-card,
.analytics-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(21, 42, 74, 0.05);
}

.analytics-card span,
.analytics-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analytics-card strong {
  display: block;
  margin: 8px 0 2px;
  color: var(--accent-strong);
  font-size: 28px;
  line-height: 1.1;
}

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

.analytics-panel h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

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

.admin-module-card,
.module-loading {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(21, 42, 74, 0.05);
}

.admin-module-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
}

.admin-module-card p {
  margin-bottom: 12px;
  color: var(--muted);
}

.admin-module-card label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-module-card input,
.admin-module-card select,
.admin-module-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.admin-module-card input,
.admin-module-card select {
  min-height: 40px;
  padding: 0 10px;
}

.admin-module-card textarea {
  min-height: 90px;
  padding: 10px;
  resize: vertical;
}

.admin-module-card label button {
  justify-self: start;
  min-height: 34px;
  margin-top: 4px;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

.compact-row {
  display: grid;
  gap: 3px;
  min-height: 48px;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.compact-row:hover {
  background: var(--accent-soft);
}

.compact-row span {
  color: var(--muted);
  font-size: 12px;
}

.module-checklist {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.module-checklist li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
}

.module-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-yellow);
  box-shadow: 0 0 0 4px rgba(246, 205, 0, 0.18);
}

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

.settings-steps article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.settings-steps strong {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
}

.personal-case-table td:nth-child(4),
.personal-case-table td:nth-child(5) {
  display: grid;
  gap: 7px;
  min-width: 210px;
  white-space: normal;
}

.personal-case-table td:nth-child(3) {
  min-width: 260px;
  white-space: normal;
}

.personal-case-table textarea {
  min-width: 220px;
}

.personal-list-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.personal-list-tools label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.personal-list-tools input,
.personal-list-tools select {
  height: 38px;
  min-height: 38px;
}

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

.personal-case-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.45fr) minmax(150px, 0.75fr) minmax(180px, 0.9fr) 66px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.personal-case-row > * {
  min-width: 0;
}

.personal-case-summary {
  display: grid;
  gap: 3px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.personal-case-summary:hover,
.personal-case-summary:focus-visible {
  background: transparent;
  color: var(--blue);
  outline: none;
}

.personal-case-id,
.personal-case-summary span,
.personal-case-need span,
.personal-case-next span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-case-summary strong,
.personal-case-need strong,
.personal-case-next strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-case-need,
.personal-case-next {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.personal-case-need span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-case-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.personal-case-badges em {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-case-actions {
  display: flex;
  justify-content: flex-end;
}

.personal-case-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.lead-case-row.is-overdue,
.personal-case-row.is-overdue {
  border-color: #f04438;
  background: #fff7f6;
  box-shadow: inset 4px 0 0 #f04438;
}

.lead-case-docs small {
  display: block;
  overflow: hidden;
  color: #b54708;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.duplicate-badges em,
.case-alert-strip > em {
  border-radius: 999px;
  background: #fff2cc;
  color: #7a4b00;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
}

.case-alert-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 0;
}

.doc-completeness {
  display: inline-grid;
  gap: 2px;
  border: 1px solid #b7dfc5;
  border-radius: 10px;
  background: #f2fff6;
  color: #067647;
  padding: 7px 10px;
}

.doc-completeness.missing {
  border-color: #fedf89;
  background: #fffbeb;
  color: #b54708;
}

.doc-completeness strong,
.doc-completeness span {
  font-size: 12px;
}

.personal-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf0;
  padding: 10px;
}

.personal-bulk-bar strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.personal-bulk-bar select {
  min-width: 220px;
  min-height: 38px;
}

.open-data-sync-card {
  border-top: 4px solid var(--brand-yellow);
}

.sync-status {
  display: grid;
  gap: 4px;
  border: 1px solid #b7dfc5;
  border-radius: 10px;
  background: #f2fff6;
  color: #067647;
  padding: 12px;
}

.sync-status.missing {
  border-color: #fedf89;
  background: #fffbeb;
  color: #b54708;
}

.sync-status strong {
  font-size: 15px;
}

.sync-status span {
  color: inherit;
  font-size: 13px;
}

.sync-command {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.6;
  padding: 12px;
  white-space: pre-wrap;
}

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

.sync-run-list article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.sync-run-list span,
.sync-run-list small {
  color: var(--muted);
  font-size: 12px;
}

.personal-case-row {
  grid-template-columns: 26px minmax(170px, 0.9fr) minmax(260px, 1.45fr) minmax(150px, 0.75fr) minmax(180px, 0.85fr) minmax(92px, 0.42fr) 66px;
}

.personal-case-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.42);
}

.personal-case-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 81;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 42px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.28);
}

.personal-case-modal header,
.personal-case-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.personal-case-modal header {
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.personal-case-modal footer {
  border-top: 1px solid var(--line);
}

.personal-case-modal h3,
.personal-case-modal h4,
.personal-case-modal p {
  margin: 0;
}

.personal-case-modal header span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.personal-case-modal header p {
  color: var(--muted);
  font-size: 13px;
}

.personal-modal-grid,
.personal-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 0;
}

.personal-modal-grid article {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.personal-modal-grid p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.personal-modal-grid p span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-modal-form {
  padding-bottom: 16px;
}

.personal-modal-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.personal-modal-form .wide {
  grid-column: 1 / -1;
}

.personal-modal-form select,
.personal-modal-form input,
.personal-modal-form textarea {
  width: 100%;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  min-height: 0;
  padding: 0;
}

.text-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

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

.rank-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.rank-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row span {
  color: var(--muted);
  white-space: nowrap;
}

.rank-row em {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #eef3f8;
  overflow: hidden;
}

.rank-row em i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--blue));
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 6px;
  height: 170px;
  align-items: end;
}

.trend-item {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.trend-item i {
  align-self: end;
  display: block;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--blue), var(--yellow));
}

.admin-table-wrap {
  max-height: 68vh;
  background: #fff;
}

.admin-table-wrap table {
  min-width: 1180px;
}

.admin-table-wrap th,
.admin-table-wrap td {
  white-space: nowrap;
}

.question-cell {
  min-width: 260px;
  max-width: 380px;
  white-space: normal !important;
  line-height: 1.45;
}

.case-cell,
.customer-cell,
.source-cell,
.file-cell,
.tracking-cell,
.action-cell {
  vertical-align: top;
}

.case-cell strong,
.customer-cell strong,
.question-cell strong,
.source-cell strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.case-cell span,
.customer-cell span,
.question-cell small,
.source-cell span,
.source-cell small,
.muted-text {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customer-cell a {
  display: block;
  color: var(--accent-strong);
  font-size: 13px;
  text-decoration: none;
}

.status-badge {
  display: inline-flex;
  margin-top: 7px;
  border: 1px solid #c7d8ee;
  border-radius: 999px;
  background: #f3f8ff;
  color: var(--accent-strong);
  padding: 4px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.priority-badge {
  display: inline-flex;
  margin-top: 6px;
  margin-left: 4px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.priority-A {
  background: #fff0c2;
  color: #7a4b00;
}

.priority-B {
  background: #eaf3ff;
  color: var(--accent-strong);
}

.priority-C,
.priority-D {
  background: #f3f4f6;
  color: var(--muted);
}

.admin-status-select,
.admin-mini-input,
.admin-note-input {
  width: 100%;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.admin-status-select,
.admin-mini-input {
  min-height: 36px;
  padding: 0 8px;
}

.admin-note-input {
  min-width: 220px;
  min-height: 58px;
  padding: 8px;
  resize: vertical;
}

.admin-save-button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.tracking-cell {
  display: grid;
  gap: 7px;
  min-width: 220px;
}

.action-cell {
  min-width: 150px;
}

.action-cell details {
  margin-top: 8px;
}

.action-cell summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
}

.admin-detail-panel {
  position: absolute;
  right: 42px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: min(980px, calc(100vw - 84px));
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(21, 45, 76, 0.18);
  padding: 14px;
  white-space: normal;
}

.admin-detail-panel h3 {
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 14px;
}

.admin-detail-panel p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.admin-log-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 12px;
}

.admin-file-list {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.admin-file-list a,
.admin-file-list span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: normal;
}

.admin-file-list span {
  color: var(--muted);
}

.admin-file-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-doc-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  min-width: 260px;
  font-size: 12px;
}

.admin-doc-checklist strong {
  grid-column: 1 / -1;
  color: var(--accent-strong);
}

.admin-doc-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.admin-doc-checklist input {
  width: auto;
  min-height: auto;
}

.document-note-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 960px) {
  .app-header,
  .admin-header,
  .admin-shell,
  .command-center,
  .home-hero,
  .sales-intro,
  .answer-grid,
  .dashboard-kpis,
  .dashboard-charts,
  .analytics-grid,
  .analytics-panels,
  .admin-module-grid,
  .settings-steps {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 0;
    padding-top: 34px;
    padding-bottom: 24px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .hero-benefits,
  .hero-proof,
  .hero-step-strip,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .sales-intro-cards {
    grid-template-columns: 1fr;
  }

  .sales-intro {
    margin-left: 0;
    margin-right: 0;
    padding: 28px;
    border: 1px solid rgba(63, 115, 184, 0.14);
    border-radius: 14px;
  }

  .sales-intro-copy {
    padding-left: 64px;
  }

  .sales-intro-copy h2 {
    font-size: 28px;
  }

  .sales-intro-cards article + article,
  .hero-step-strip button + button,
  .trust-strip article + article {
    border-left: 0;
    border-top: 1px solid rgba(63, 115, 184, 0.14);
  }

  .hero-step-strip button:not(:last-child)::after {
    right: 22px;
    transform: translateY(-50%) rotate(135deg);
  }

  .trust-strip {
    margin-left: 0;
    margin-right: 0;
    border: 1px solid rgba(63, 115, 184, 0.14);
    border-radius: 14px;
    overflow: hidden;
  }

  .hero-visual {
    min-height: 320px;
  }

  .hero-visual img {
    height: 320px;
  }

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

  .evidence-row {
    grid-template-columns: 92px minmax(220px, 1fr);
  }

  .evidence-metrics,
  .evidence-actions,
  .evidence-detail {
    grid-column: 1 / -1;
  }

  .evidence-actions {
    justify-content: flex-start;
  }

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

  .side-panel {
    position: static;
  }

  .data-badges {
    justify-content: start;
  }
}

@media (max-width: 720px) {
  .app-header,
  .admin-header,
  .admin-shell,
  .admin-workspace,
  .workspace {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 25px;
  }

  .chat-panel,
  .panel {
    padding: 14px;
  }

  .chat-panel-head {
    display: grid;
  }
  .query-progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-result-notice {
    display: grid;
  }

  .query-result-actions {
    justify-content: stretch;
  }

  .query-result-actions button {
    flex: 1 1 140px;
  }

  .chat-messages {
    min-height: 62vh;
    max-height: 72vh;
  }

  .hero-actions,
  .hero-actions button,
  .prompt-cards,
  .chat-cta-row button {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: 30px;
  }

  .hero-benefits span,
  .hero-proof div,
  .hero-step-strip button,
  .sales-intro-cards article {
    min-height: 0;
  }

  .brand-lockup {
    align-items: center;
    margin-bottom: 14px;
  }

  .brand-logo {
    width: min(190px, 62vw);
  }

  .hero-benefits {
    border-radius: 12px;
  }

  .hero-benefits span {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 12px;
  }

  .hero-benefits span + span {
    border-left: 0;
    border-top: 1px solid rgba(63, 115, 184, 0.14);
  }

  .hero-step-strip button {
    grid-template-columns: 42px minmax(0, 1fr);
    padding-right: 44px;
  }

  .step-icon {
    width: 40px;
    height: 40px;
  }

  .sales-intro {
    padding: 20px;
  }

  .sales-intro-copy {
    padding-left: 0;
  }

  .sales-intro-copy::before {
    display: none;
  }

  .sales-intro-copy h2 {
    font-size: 25px;
  }

  .sales-intro-cards article {
    padding: 24px 18px 18px;
  }

  .trust-strip article {
    padding: 18px;
  }

  .hero-result-card {
    position: static;
    max-width: none;
    margin-top: 10px;
  }

  .hero-visual {
    display: grid;
  }

  .hero-visual img {
    height: 250px;
  }

  .prompt-cards {
    grid-template-columns: 1fr;
  }

  .advisor-options {
    grid-template-columns: 1fr;
  }

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

  .chat-status {
    justify-self: start;
  }

  .chat-input-row,
  .case-lookup-panel,
  .case-lookup-form,
  .document-checklist,
  .panel-head,
  .admin-login-form,
  .admin-toolbar,
  .email-verify-actions,
  .lead-form,
  .note-choice {
    grid-template-columns: 1fr;
    display: grid;
  }

  .case-result-card {
    grid-template-columns: 1fr;
  }

  .admin-login {
    margin-top: 22px;
  }

  .admin-actions {
    justify-content: stretch;
  }

  .admin-actions input,
  .admin-actions button,
  .case-tools,
  .case-tools button,
  .case-tools label {
    width: 100%;
  }

  .case-tools {
    justify-content: stretch;
  }

  .case-tools select {
    flex: 1;
    width: auto;
  }

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

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

  .evidence-metrics span {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    padding-left: 0;
  }

  .evidence-actions,
  .evidence-actions button {
    width: 100%;
  }

  .evidence-detail dl {
    grid-template-columns: 1fr;
  }

  .evidence-analysis {
    padding: 12px;
  }

  .comparison-list,
  .area-list,
  .dashboard-kpis,
  .dashboard-charts,
  .message-cards {
    grid-template-columns: 1fr;
  }

  .chart-card {
    min-height: 0;
  }
}

.admin-mobile-menu-toggle,
.admin-sidebar-backdrop {
  display: none;
}

@media (max-width: 960px) {
  body.admin-body {
    overflow-x: hidden;
  }

  body.admin-menu-open {
    overflow: hidden;
  }

  .admin-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 16px;
    box-shadow: 0 8px 24px rgba(31, 64, 104, 0.10);
    backdrop-filter: blur(14px);
  }

  .admin-header > div {
    flex: 1;
    min-width: 0;
  }

  .admin-header .eyebrow,
  .admin-header p {
    display: none;
  }

  .admin-header h1 {
    overflow: hidden;
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-header .admin-link {
    min-height: 40px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .admin-mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 72px;
    min-height: 42px;
    border: 1px solid #c7d8ee;
    border-radius: 8px;
    background: #fff;
    color: var(--accent-strong);
    padding: 0 10px;
    box-shadow: none;
  }

  .admin-mobile-menu-toggle span,
  .admin-mobile-menu-toggle span::before,
  .admin-mobile-menu-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .admin-mobile-menu-toggle span {
    position: relative;
  }

  .admin-mobile-menu-toggle span::before,
  .admin-mobile-menu-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .admin-mobile-menu-toggle span::before {
    top: -6px;
  }

  .admin-mobile-menu-toggle span::after {
    top: 6px;
  }

  .admin-mobile-menu-toggle[aria-expanded="true"] span {
    background: transparent;
  }

  .admin-mobile-menu-toggle[aria-expanded="true"] span::before {
    top: 0;
    transform: rotate(45deg);
  }

  .admin-mobile-menu-toggle[aria-expanded="true"] span::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .admin-shell {
    display: block;
    width: 100%;
    padding: 16px;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1210;
    display: grid;
    align-content: start;
    width: min(86vw, 340px);
    max-height: 100dvh;
    overflow-y: auto;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0 12px 12px 0;
    background: #fff;
    padding: max(24px, env(safe-area-inset-top)) 16px 28px;
    box-shadow: 18px 0 50px rgba(16, 24, 40, 0.22);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  .admin-menu-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-sidebar strong {
    margin: 8px 4px 2px;
    font-size: 13px;
  }

  .admin-sidebar button {
    min-height: 48px;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
  }

  .admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.42);
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .admin-menu-open .admin-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-workspace {
    width: 100%;
    min-width: 0;
    padding: 0;
  }

  .admin-panel {
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(31, 64, 104, 0.08);
  }

  .admin-toolbar {
    gap: 12px;
  }

  .admin-toolbar h2 {
    font-size: 23px;
    line-height: 1.3;
  }

  .admin-module-card {
    padding: 16px;
  }

  .personal-case-modal,
  .lead-case-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .personal-case-modal header {
    position: sticky;
    top: 0;
    z-index: 3;
    align-items: flex-start;
    padding: 12px;
  }

  .personal-case-modal header > div {
    min-width: 0;
  }

  .personal-case-modal header h3,
  .personal-case-modal header p {
    overflow-wrap: anywhere;
  }

  .personal-case-modal header button {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 40px;
    padding: 0 10px;
  }

  .personal-modal-grid,
  .personal-modal-form,
  .lead-modal-sections {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .personal-modal-grid article,
  .lead-modal-sections article {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .personal-modal-form label,
  .personal-modal-form .wide {
    grid-column: 1;
    min-width: 0;
  }

  .personal-modal-form input,
  .personal-modal-form select,
  .personal-modal-form textarea {
    width: 100%;
    min-width: 0;
  }

  .admin-doc-checklist {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    min-width: 0;
    font-size: 15px;
  }

  .admin-doc-checklist label {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    line-height: 1.4;
  }

  .admin-doc-checklist label span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .admin-doc-checklist input {
    width: 22px;
    height: 22px;
    margin: 0;
  }

  .lead-modal-sections .admin-file-list,
  .lead-modal-sections .admin-log-list {
    width: 100%;
    min-width: 0;
    max-height: 220px;
    overflow: auto;
    overflow-wrap: anywhere;
  }

  .personal-case-modal footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.97);
    padding: 12px;
    backdrop-filter: blur(12px);
  }

  .personal-case-modal footer button {
    min-height: 44px;
  }

  .admin-locked .admin-mobile-menu-toggle,
  .admin-locked .admin-sidebar-backdrop {
    display: none;
  }
}

@media (max-width: 420px) {
  .admin-header h1 {
    font-size: 16px;
  }

  .admin-mobile-menu-toggle {
    min-width: 44px;
    width: 44px;
    padding: 0;
  }

  .admin-mobile-menu-toggle b {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .admin-header .admin-link {
    padding: 0 9px;
    font-size: 13px;
  }

  .admin-shell {
    padding: 12px;
  }

  .admin-panel {
    padding: 12px;
  }

  .personal-case-modal footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .personal-case-modal footer button {
    width: 100%;
  }
}

/* Front menu and fixed hero background */
.home-hero {
  padding: 22px max(32px, calc((100vw - 1360px) / 2 + 32px)) 58px;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.40) 52%, rgba(69, 121, 189, 0.18) 100%),
    url("/assets/hero-sales-finance-image2.png") right 18% top 120px / min(52vw, 760px) auto no-repeat fixed;
  opacity: 0.38;
}

.site-topbar {
  position: relative;
  z-index: 4;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin-bottom: 10px;
}

.site-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.site-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(63, 115, 184, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #1f3d66;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(31, 64, 104, 0.08);
  backdrop-filter: blur(12px);
}

.site-menu a:hover,
.site-menu a:focus-visible {
  border-color: rgba(6, 70, 168, 0.35);
  background: #fff;
  color: #0646a8;
  outline: none;
}

.site-topbar .brand-lockup {
  margin-bottom: 0;
  text-decoration: none;
}

.site-topbar .brand-lockup:hover .brand-logo,
.site-topbar .brand-lockup:focus-visible .brand-logo {
  transform: translateY(-1px);
  filter: drop-shadow(0 10px 18px rgba(31, 64, 104, 0.16));
}

.site-topbar .brand-lockup:focus-visible {
  border-radius: 12px;
  outline: 3px solid rgba(69, 121, 189, 0.22);
  outline-offset: 4px;
}

.brand-logo {
  transition: transform 0.18s ease, filter 0.18s ease;
}

.hero-visual {
  z-index: 1;
}

@media (max-width: 960px) {
  .home-hero {
    padding-top: 18px;
  }

  .home-hero::before {
    background-attachment: scroll, scroll;
    background-size: auto, 110vw auto;
    background-position: center, right -120px top 90px;
    opacity: 0.14;
  }

  .site-topbar {
    align-items: flex-start;
    gap: 14px;
  }

  .site-menu {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  .site-topbar {
    display: grid;
    gap: 12px;
  }

  .site-menu {
    width: calc(100vw - 32px);
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 0 4px;
    scrollbar-width: thin;
  }

  .site-menu a {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .site-topbar .brand-logo {
    width: min(176px, 58vw);
  }
}
