:root {
  color-scheme: light;
  --navy: #071a2d;
  --blue: #0877f9;
  --blue-dark: #075fc5;
  --green: #0c9b69;
  --red: #c53636;
  --ink: #102033;
  --muted: #667487;
  --line: #dce3eb;
  --surface: #ffffff;
  --background: #f3f6f9;
  --shadow: 0 10px 30px rgba(8, 29, 54, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.app-header {
  background: var(--navy); color: white; padding: calc(18px + env(safe-area-inset-top)) 20px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.app-header h1 { font-size: 22px; margin: 2px 0 0; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #72afff; }
.icon-button { border: 0; background: rgba(255,255,255,.1); color: inherit; width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }

.tabs { background: white; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
.tab { border: 0; background: transparent; padding: 15px 8px 13px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

main { width: min(760px, 100%); margin: 0 auto; padding: 18px 14px calc(36px + env(safe-area-inset-bottom)); }
.view { display: none; }
.view.active { display: block; }
.card { background: var(--surface); border: 1px solid #e5eaf0; border-radius: 20px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2 { margin: 0 0 7px; font-size: 21px; }
.card p { margin: 0; line-height: 1.5; color: var(--muted); }
.hero-card { display: grid; grid-template-columns: 52px 1fr; gap: 12px; }
.hero-card .stack { grid-column: 1 / -1; }
.maps-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50% 50% 50% 8px; background: linear-gradient(135deg,#4285f4,#34a853); color:white; font-weight:900; font-size:22px; transform: rotate(-8deg); }
.maps-mark::first-letter { transform: rotate(8deg); }

.stack { display: grid; gap: 12px; }
label { font-size: 13px; font-weight: 800; color: #26384d; }
input, textarea { width: 100%; border: 1px solid #ccd6e2; border-radius: 12px; padding: 13px 14px; color: var(--ink); background: white; outline: none; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8,119,249,.13); }
textarea { resize: vertical; line-height: 1.45; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.primary, .secondary, .sent-button { border: 0; border-radius: 12px; min-height: 48px; padding: 12px 16px; font-weight: 800; }
.primary { background: var(--blue); color: white; }
.primary:hover { background: var(--blue-dark); }
.primary:disabled { opacity: .55; cursor: wait; }
.secondary { background: #e9f1fa; color: #17416d; }
.compact { min-height: 44px; padding: 10px 14px; }
.sent-button { background: #dff6ed; color: #08734f; border: 1px solid #a9e4cf; }
.text-button { border: 0; background: transparent; color: var(--blue); font-weight: 750; padding: 8px; }

.loading { display: flex; gap: 14px; align-items: center; }
.loading span { display: block; color: var(--muted); margin-top: 3px; font-size: 14px; }
.spinner { width: 34px; height: 34px; border: 4px solid #dce8f6; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-line { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; font-weight: 800; margin-bottom: 18px; }
.status-dot { width: 9px; height: 9px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px #dcf6ec; }
.lookup-notice { margin: -4px 0 18px; padding: 11px 12px; border-radius: 11px; background: #fff7df; border: 1px solid #efd998; color: #705514; font-size: 12px; line-height: 1.45; font-weight: 650; }
.business-heading { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.badge { display: inline-block; background: #eaf3ff; color: #1662b1; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; margin-bottom: 8px; }
.map-link { color: var(--blue); font-size: 13px; font-weight: 800; white-space: nowrap; }
.details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 20px 0 0; }
.details-grid div { background: #f5f8fb; border-radius: 12px; padding: 11px; min-width: 0; }
.details-grid dt { color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.details-grid dd { margin: 0; font-size: 13px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.details-grid.listing-details { grid-template-columns: 2fr 1fr; }
.required { color: #a93636; font-weight: 750; }
.top-rule { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.message-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }

.success-card { text-align: center; }
.success-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 13px; background: #daf5e9; color: var(--green); font-size: 28px; font-weight: 900; }
.success-card p { margin-bottom: 20px; }
.error-banner { position: fixed; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 700px; margin: auto; background: #fff0f0; color: #8c2525; border: 1px solid #f1b8b8; padding: 14px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 8; }

.list-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.prospect-list { display: grid; gap: 10px; }
.prospect-item { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 15px; box-shadow: 0 5px 16px rgba(8,29,54,.05); }
.prospect-top { display: flex; justify-content: space-between; gap: 10px; }
.prospect-controls { display: grid; justify-items: end; gap: 8px; flex: 0 0 auto; }
.prospect-item h3 { margin: 0 0 4px; font-size: 16px; }
.prospect-item p { margin: 0; color: var(--muted); font-size: 13px; }
.status-pill { border-radius: 999px; padding: 5px 8px; background: #eef3f8; color: #4a5d72; font-size: 10px; font-weight: 850; white-space: nowrap; height: fit-content; text-transform: uppercase; }
.status-pill.dnc { color: #972b2b; background: #ffe7e7; }
.prospect-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; color: #52677e; font-size: 12px; }
.delete-prospect { border: 1px solid #efb1b1; background: #fff0f0; color: var(--red); border-radius: 9px; font-size: 12px; font-weight: 850; padding: 8px 11px; min-width: 84px; }
.delete-prospect:hover { background: #ffe1e1; border-color: #df8181; }
.delete-prospect:disabled { opacity: .55; cursor: wait; }
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--ink); margin-bottom: 6px; }

dialog { border: 0; border-radius: 20px; width: min(500px, calc(100% - 24px)); padding: 0; box-shadow: 0 25px 70px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(5,19,34,.62); }
dialog form { padding: 20px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; }
.dialog-heading h2 { margin: 2px 0 0; }
.dialog-heading .icon-button { background: #eff3f7; color: var(--ink); }
.helper { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

@media (max-width: 520px) {
  .details-grid, .details-grid.listing-details { grid-template-columns: 1fr; }
  .details-grid div { display: grid; grid-template-columns: 92px 1fr; align-items: center; }
  .details-grid dt { margin: 0; }
  .message-meta { display: grid; }
}
