@font-face {
  font-family: Vazirmatn;
  src: url('/static/fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #f3f5f3; --surface: #fff; --ink: #193137; --muted: #62777a;
  --line: #dde5e1; --primary: #126d5f; --primary-dark: #0c5147;
  --green: #126d5f; --red: #ae3841; --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.8 Vazirmatn, Tahoma, sans-serif; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #d59734; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.6; letter-spacing: -.6px; margin-bottom: 7px; font-weight: 750; }
h2 { font-size: 16px; margin-bottom: 0; font-weight: 750; }
h3 { font-size: 13px; margin-bottom: 12px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 11px; line-height: 1.9; margin: 6px 0 10px; }
.hidden { display: none !important; }
.topbar { background: #112b30; color: white; min-height: 78px; padding: 14px max(24px, calc((100vw - 1440px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: white; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font: 600 18px/1.4 Arial, sans-serif; direction: ltr; }
.brand small { color: #b6cbc7; font-size: 10px; }
.brand-mark { width: 43px; height: 43px; border: 1px solid #6e9f94; border-radius: 11px; display: grid; place-items: center; font: 700 24px Arial, sans-serif; color: #a7e2cd; background: #1a3d3e; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.topbar .ghost { color: #dbe8e3; border-color: #426160; }
.user-chip { font-size: 12px; color: #b6cbc7; }
.page-shell { max-width: 1440px; margin: auto; padding: 34px 24px 20px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading .muted { font-size: 12px; margin-bottom: 0; }
.text-link { font-size: 12px; white-space: nowrap; }
.workspace-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-heading .hint { margin-bottom: 0; }
.subtle-label { color: var(--muted); font-size: 11px; background: #edf3ef; padding: 2px 10px; border-radius: 5px; }
.field-label { display: block; font-size: 12px; font-weight: 650; margin: 13px 0 7px; }
textarea, input:not([type=checkbox]), select { width: 100%; min-width: 0; border: 1px solid #cdd9d3; border-radius: 7px; background: #fdfefd; color: var(--ink); padding: 9px 11px; transition: border-color .15s; }
input:not([type=checkbox]), select { min-height: 43px; }
textarea { resize: vertical; min-height: 72px; }
textarea:focus, input:focus, select:focus { border-color: var(--primary); }
textarea::placeholder, input::placeholder { color: #81938f; }
input[type=checkbox] { accent-color: var(--primary); width: 17px; height: 17px; flex: 0 0 auto; margin: 0; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.two-fields label { font-size: 11px; }
.two-fields input, .two-fields select { display: block; margin-top: 6px; }
.align-end { align-self: end; }
.section-divider { border-top: 1px solid var(--line); margin: 22px 0; }
.segmented { display: flex; padding: 4px; background: #edf2ee; border-radius: 8px; gap: 4px; }
.segment { border: 0; background: transparent; color: var(--muted); padding: 7px 8px; flex: 1; border-radius: 5px; font-size: 11px; min-height: 36px; }
.segment.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px #173b2914; font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 11px; line-height: 1.9; margin-top: 16px; }
.advanced { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; font-size: 12px; }
.advanced summary { padding: 4px 0; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; border-radius: 7px; padding: 8px 15px; border: 1px solid transparent; font-size: 12px; font-weight: 650; transition: background .15s, border-color .15s; white-space: nowrap; }
.button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--primary); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-dark); }
.secondary { border-color: #cdd9d3; color: var(--ink); background: #fff; }
.secondary:hover:not(:disabled) { background: #f0f6f2; border-color: #89b1a2; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.danger { background: #fff; color: var(--red); border-color: #e8c8cc; }
.small { font-size: 11px; min-height: 34px; padding: 5px 12px; }
.full { width: 100%; }
.start-button { margin-top: 22px; min-height: 49px; justify-content: space-between; }
.form-message { font-size: 12px; color: var(--green); margin-top: 12px; overflow-wrap: anywhere; }
.form-message:empty { display: none; }
.form-message.is-error { color: var(--red); }
.main-workspace { display: grid; gap: 20px; min-width: 0; }
.source-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 16px; font-size: 11px; }
.source-search { display: flex; align-items: center; gap: 8px; max-width: 300px; width: 100%; }
.source-search input { background: #f8faf8; min-height: 37px; font-size: 11px; }
.provider-list { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; }
.source-option { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 10px 12px; min-height: 46px; border-radius: 7px; cursor: pointer; }
.source-option span { font-size: 12px; font-weight: 600; }
.source-option small { display: block; flex-basis: 100%; padding-right: 25px; font-size: 9px; color: var(--muted); margin-top: -6px; }
.source-option.selected { background: #f0f7f2; border-color: #9bc4af; }
.source-note { font-size: 10px; color: var(--muted); margin: 15px 0 0; line-height: 1.9; }
.map-panel { padding-bottom: 12px; overflow: hidden; }
.area-label { font-size: 11px; color: var(--primary); }
#map { height: 280px; border-radius: 7px; border: 1px solid var(--line); z-index: 0; background: #e6ebe4; }
.map-message:empty { display: none; }
.leaflet-container { font-family: Vazirmatn, Tahoma, sans-serif; }
.results-panel, .history-panel { margin-top: 24px; }
.results-heading { margin-bottom: 20px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.metrics > div { padding-inline: 20px; border-left: 1px solid var(--line); }
.metrics > div:first-child { padding-right: 0; }
.metrics > div:last-child { border-left: 0; }
.metrics span { display: block; font-size: 11px; color: var(--muted); }
.metrics strong { font-size: 25px; font-weight: 650; display: block; margin-top: 3px; line-height: 1.6; }
.metrics > div:first-child strong { color: var(--primary); }
.progress-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; margin-bottom: 8px; }
.progress-track { height: 6px; background: #e9efea; border-radius: 5px; overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.empty-state { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty-state strong { display: block; color: var(--ink); font-size: 14px; }
.empty-state p { font-size: 12px; margin-bottom: 0; }
.empty-icon { font-size: 36px; color: #97b0a5; line-height: 1.4; }
.job-feedback { color: var(--muted); font-size: 12px; padding: 14px 0; }
.source-report { padding: 12px 14px; background: #f8faf7; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; margin: 12px 0; }
.source-report-row { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.source-report-row:first-child { margin-top: 12px; }
.source-report-row p { grid-column: 1 / -1; color: #915b31; margin: 0; overflow-wrap: anywhere; white-space: pre-line; font-size: 10px; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 0; font-size: 11px; }
.results-toolbar .check-row { margin: 0; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 960px; text-align: right; }
th { background: #f4f7f4; padding: 13px 14px; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
td { padding: 16px 14px; border-top: 1px solid var(--line); font-size: 12px; vertical-align: top; max-width: 270px; }
td small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
td strong { font-weight: 650; }
tr:hover td { background: #fafcf9; }
.phone-line { display: flex; direction: ltr; justify-content: flex-end; align-items: center; gap: 12px; white-space: nowrap; }
.phone-line a { font-family: Vazirmatn, sans-serif; letter-spacing: .5px; }
.copy-phone { border: 0; color: var(--muted); font-size: 9px; background: transparent; padding: 7px 3px; }
.score-pair { display: flex; gap: 6px; }
.score-pair span { background: #eaf3ed; border: 1px solid #c7dfd0; color: #24674b; min-width: 34px; text-align: center; border-radius: 5px; padding: 2px 6px; }
.score-pair span + span { background: #eff2f7; border-color: #d6dfe9; color: #405b7a; }
.opportunity { display: block; background: #fbf4e8; color: #815d24; font-size: 10px; padding: 4px 7px; border-radius: 4px; margin-bottom: 5px; }
.text-button { color: var(--primary); background: transparent; padding: 6px 0; border: 0; font-size: 11px; text-align: right; }
.more-button { display: flex; margin: 20px auto 0; }
.alert { border: 1px solid #e5bcc0; background: #fff3f3; border-radius: 7px; padding: 12px; color: var(--red); font-size: 12px; }
.jobs-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.job-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 7px; text-align: right; color: var(--ink); }
.job-row:hover { border-color: #8daf9c; background: #fbfdfb; }
.job-row strong { font-size: 12px; display: block; }
.job-row small { font-size: 10px; color: var(--muted); display: block; margin-top: 4px; }
.status-badge { border-radius: 4px; padding: 3px 8px; font-size: 10px; white-space: nowrap; background: #edf1ed; color: #526963; }
.status-badge.completed { background: #e5f3e8; color: #286a42; }
.status-badge.running { background: #e9f0fa; color: #37628d; }
.status-badge.failed { background: #fbecec; color: var(--red); }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 0; font-size: 10px; color: var(--muted); }
.lead-dialog { width: min(680px, calc(100% - 32px)); max-height: 85vh; border: 1px solid var(--line); border-radius: 12px; padding: 24px; color: var(--ink); font: inherit; }
.lead-dialog::backdrop { background: #102d3370; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-links { display: flex; gap: 20px; margin-bottom: 22px; }
.lead-dialog h3 { margin-top: 22px; }
.lead-dialog p { font-size: 12px; overflow-wrap: anywhere; }
.evidence { border: 1px solid var(--line); border-radius: 7px; padding: 12px; margin-top: 10px; font-size: 12px; }
.evidence span { margin-right: 15px; color: var(--muted); }
.evidence p { margin: 6px 0; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: white; border: 1px solid var(--line); padding: 36px; border-radius: 16px; width: min(420px, 100%); }
.login-card .brand-mark { margin-bottom: 22px; }
.login-card .muted { font-size: 12px; margin-bottom: 24px; }
.eyebrow { color: var(--muted); direction: ltr; font-size: 10px; letter-spacing: 1px; }
.stack { display: grid; gap: 16px; }
.stack label { font-size: 12px; }
.stack input { margin-top: 6px; }
.footnote { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 10px; }
@media (min-width: 1600px) { #map { height: 320px; } }
@media (max-width: 1100px) {
  .workspace-grid { grid-template-columns: 310px minmax(0, 1fr); gap: 16px; }
  .provider-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel { padding: 18px; }
  .metrics strong { font-size: 21px; }
}
@media (max-width: 800px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .main-workspace { gap: 16px; }
  .provider-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .page-heading { align-items: flex-start; }
  .text-link { display: none; }
  .page-shell { padding: 24px 16px; }
  .results-heading { flex-direction: column; align-items: stretch; }
  .result-actions { justify-content: flex-start; }
  .metrics { grid-template-columns: repeat(3,1fr); gap: 18px 0; }
  .metrics > div { padding-inline: 12px; }
  .metrics > div:nth-child(3) { border-left: 0; }
  .metrics > div:first-child { padding-right: 12px; }
  .results-toolbar { flex-wrap: wrap; }
  .jobs-list { grid-template-columns: 1fr; }
  .page-footer { flex-direction: column; gap: 5px; }
}
@media (max-width: 480px) {
  .topbar { min-height: 70px; padding: 12px 16px; }
  .user-chip { display: none; }
  .brand strong { font-size: 16px; }
  .page-shell { padding: 22px 12px; }
  .panel { padding: 16px; }
  .provider-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .source-option { padding: 10px; }
  .source-toolbar { gap: 10px; }
  .source-toolbar .muted { white-space: nowrap; font-size: 10px; }
  .metrics strong { font-size: 18px; }
  .result-actions .button { flex-grow: 1; padding-inline: 12px; }
  .source-report-row { grid-template-columns: 1fr; }
  #map { height: 250px; }
  .source-option span { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (pointer: coarse) { .button.small, .copy-phone, .text-button { min-height: 44px; min-width: 44px; } }
