:root{
  color-scheme:light;--ink:#0f172a;--ink-soft:#334155;--muted:#64748b;--surface:#fff;--surface-tint:#f8fbff;
  --line:#dbe5f0;--line-strong:#c9d7e6;--blue:#2563eb;--blue-deep:#1d4ed8;--blue-soft:#eaf2ff;
  --violet:#7c3aed;--violet-soft:#f2ecff;--green:#15803d;--green-soft:#eaf7ef;--amber:#a16207;
  --amber-soft:#fff5db;--red:#b91c1c;--red-soft:#feeeee;--shadow:0 10px 30px rgba(15,23,42,.07);
  --radius:18px;--shell:min(1240px,calc(100vw - 40px));font-family:Inter,"Segoe UI Variable","Segoe UI",Arial,sans-serif
}
*{box-sizing:border-box}body{margin:0;min-height:100dvh;color:var(--ink);background:
radial-gradient(circle at 10% -10%,rgba(37,99,235,.12),transparent 34rem),
radial-gradient(circle at 90% 8%,rgba(124,58,237,.09),transparent 30rem),
linear-gradient(180deg,#f8fbff 0,#f4f7fb 48%,#f7f9fc 100%);font-size:16px;line-height:1.5}
button,input,select{font:inherit}.shell{width:var(--shell);margin-inline:auto}
.app-header{position:sticky;top:0;z-index:60;border-bottom:1px solid rgba(201,215,230,.85);background:rgba(255,255,255,.86);backdrop-filter:blur(18px)}
.header-row{min-height:76px;display:flex;align-items:center;gap:1.5rem}.brand{display:inline-flex;align-items:center;gap:.8rem;padding:0;border:0;background:none;cursor:pointer;text-align:left}
.brand-mark{position:relative;width:38px;height:38px;flex:0 0 38px;border-radius:12px;background:linear-gradient(145deg,#0f172a 0,#2563eb 60%,#7c3aed 100%);box-shadow:0 8px 22px rgba(37,99,235,.24)}
.brand-mark:before{content:"";position:absolute;top:8px;left:9px;width:13px;height:13px;border:3px solid #fff;border-radius:50%}.brand-mark:after{content:"";position:absolute;top:23px;left:22px;width:10px;height:3px;transform:rotate(45deg);background:#fff;border-radius:999px}
.brand-mark i{display:none}.brand-copy{display:grid;line-height:1.08}.brand-copy strong{font-size:1rem;font-weight:780;letter-spacing:-.025em}.brand-copy small{margin-top:.24rem;color:var(--muted);font-size:.7rem;font-weight:650;letter-spacing:.06em;text-transform:uppercase}
.main-nav{display:flex;align-items:center;gap:.25rem;margin-left:auto}.nav-link{padding:.66rem .9rem;border:0;border-radius:10px;background:transparent;color:var(--muted);cursor:pointer;font-weight:680}.nav-link:hover,.nav-link.is-active{background:var(--blue-soft);color:var(--blue-deep)}
.primary,.secondary{border:0;border-radius:11px;cursor:pointer;font-weight:720}.primary{padding:.78rem 1.05rem;background:linear-gradient(135deg,var(--blue),var(--blue-deep) 68%,#2343ba);color:#fff;box-shadow:0 8px 18px rgba(37,99,235,.18)}.secondary{padding:.74rem 1rem;border:1px solid var(--line-strong);background:#fff;color:var(--ink-soft)}.primary:disabled{opacity:.45;cursor:not-allowed}.primary-large{padding:.92rem 1.2rem}
.app-main{padding:42px 0 72px}.view{display:none}.view.is-active{display:block}.page-heading,.builder-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:2rem;margin-bottom:28px}.page-heading h1,.builder-heading h1{margin:.2rem 0 .45rem;font-size:clamp(2rem,4vw,3.1rem);line-height:1.03;letter-spacing:-.045em}.eyebrow{margin:0;color:var(--blue-deep);font-size:.76rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.lead{max-width:760px;margin:0;color:var(--muted);font-size:1.05rem}
.heading-meta{display:flex;align-items:center;gap:.55rem;color:var(--muted)}.system-dot{width:9px;height:9px;border-radius:50%;background:var(--amber);box-shadow:0 0 0 5px var(--amber-soft)}.system-dot.ok{background:var(--green);box-shadow:0 0 0 5px var(--green-soft)}
.toolbar{display:flex;gap:12px;margin-bottom:20px}.search-field{flex:1}.search-field input,.field-group input,.field-group select{width:100%;padding:.82rem .9rem;border:1px solid var(--line-strong);border-radius:12px;background:#fff;color:var(--ink)}
.history-list{display:grid;gap:12px}.history-row{display:grid;grid-template-columns:1fr auto;gap:20px;padding:20px 22px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.9);box-shadow:var(--shadow);cursor:pointer}.history-row h3{margin:0 0 5px}.history-row p{margin:0;color:var(--muted)}
.status{display:inline-flex;align-items:center;padding:.45rem .65rem;border-radius:999px;background:var(--blue-soft);color:var(--blue-deep);font-size:.8rem;font-weight:800}.status.completed{background:var(--green-soft);color:var(--green)}.status.failed{background:var(--red-soft);color:var(--red)}.status.waiting_captcha{background:var(--amber-soft);color:var(--amber)}
.empty-state{display:flex;gap:18px;padding:34px;border:1px dashed var(--line-strong);border-radius:18px;background:rgba(255,255,255,.55)}.empty-index{font-size:2rem;font-weight:850;color:var(--blue)}.empty-state h2{margin:0 0 6px}.empty-state p{margin:0;color:var(--muted)}
.back-link{margin-bottom:20px;padding:0;border:0;background:none;color:var(--blue-deep);font-weight:750;cursor:pointer}.method-note{min-width:280px;padding:16px 18px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.8)}.method-note span{display:block;color:var(--muted);font-size:.76rem;text-transform:uppercase;letter-spacing:.08em}.method-note strong{display:block;margin:.2rem 0}.method-note p{margin:0;color:var(--muted);font-size:.88rem}
.builder-card,.visual-card,.result-hero,.captcha-panel,.system-card{border:1px solid var(--line);border-radius:var(--radius);background:rgba(255,255,255,.9);box-shadow:var(--shadow)}.builder-card{position:relative;padding:28px}.section-number{position:absolute;top:24px;left:24px;width:36px;height:36px;display:grid;place-items:center;border-radius:12px;background:var(--ink);color:#fff;font-weight:800}.section-body{padding-left:56px}
.new-analysis-grid{display:grid;grid-template-columns:minmax(0,.9fr) minmax(420px,1.1fr);gap:28px}.analysis-form{display:grid;gap:22px}.field-group label{display:block;margin-bottom:8px;font-weight:760}.address-row{display:grid;grid-template-columns:1fr auto;gap:10px}.field-help{margin:7px 0 0;color:var(--muted);font-size:.86rem}.address-results{display:grid;gap:7px;margin-top:9px}.address-result{padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer;text-align:left}
.selected-point{display:flex;justify-content:space-between;gap:15px;padding:13px 14px;border-radius:12px;background:var(--blue-soft)}.selected-point span{display:block;color:var(--muted);font-size:.75rem}.selected-point strong{display:block}.selected-point code{align-self:center;color:var(--blue-deep)}
.source-preview{padding:14px;border:1px solid var(--line);border-radius:14px;background:#fbfdff}.source-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.source-chips span{padding:.36rem .55rem;border-radius:999px;background:var(--violet-soft);color:#5b21b6;font-size:.78rem;font-weight:700}
.map-header{display:flex;justify-content:space-between;margin-bottom:9px;font-weight:750}.map-header small{color:var(--muted);font-weight:500}.map{height:520px;border:1px solid var(--line);border-radius:16px;overflow:hidden}
.analysis-heading{align-items:center}.message{padding:18px;margin-bottom:18px;border-radius:14px}.error-message{background:var(--red-soft);color:var(--red)}.captcha-panel{padding:20px;margin-bottom:20px;border-color:#f2d18a;background:#fffaf0}.captcha-image-frame{width:100%;aspect-ratio:16/10;margin-top:12px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#f8fafc}.captcha-card img{display:block;width:100%;height:100%;object-fit:contain;background:#fff}.captcha-card img.is-clickable{cursor:crosshair}.captcha-state{min-height:1.35rem;margin-top:8px;color:var(--muted);font-size:.82rem}.captcha-actions{display:flex;gap:10px;margin-top:10px}
.result-hero{display:grid;grid-template-columns:1fr auto;gap:30px;padding:26px;margin-bottom:20px}.result-hero h2,.visual-card h2{margin:.2rem 0}.metric-grid{display:grid;grid-template-columns:repeat(3,minmax(120px,1fr));gap:10px}.metric-grid article{padding:14px;border:1px solid var(--line);border-radius:13px;background:var(--surface-tint)}.metric-grid span{display:block;color:var(--muted);font-size:.76rem}.metric-grid strong{font-size:1.5rem}
.result-layout{display:grid;grid-template-columns:2fr 1fr;gap:20px;align-items:start}.result-layout>.visual-card{margin-bottom:0}.visual-card{padding:22px;margin-bottom:20px}.visual-card-head{margin-bottom:16px}.timeline{display:grid;gap:12px}.timeline-item{position:relative;padding:15px 15px 15px 72px;border:1px solid var(--line);border-radius:14px;background:#fff}.timeline-year{position:absolute;left:14px;top:15px;min-width:44px;color:var(--blue-deep);font-weight:850}.timeline-item h3{margin:0 0 5px;font-size:1rem}.timeline-item p{margin:0;color:var(--muted);font-size:.9rem}.timeline-item a,.gallery-card a,.map-card a,.document-row a{color:var(--blue-deep);font-weight:700;text-decoration:none}
.source-statuses{display:grid;gap:8px}.source-status-row{display:flex;justify-content:space-between;gap:12px;padding:11px 12px;border-radius:11px;background:var(--surface-tint)}.source-status-row small{color:var(--muted)}
.gallery,.map-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}.gallery-card,.map-card{overflow:hidden;border:1px solid var(--line);border-radius:14px;background:#fff}.gallery-card img,.map-card img{display:block;width:100%;height:170px;object-fit:cover;background:#eef2f7}.gallery-card div,.map-card div{padding:11px}.gallery-card h3,.map-card h3{margin:0 0 4px;font-size:.92rem}
.document-list{display:grid;gap:9px}.document-row{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:12px 13px;border:1px solid var(--line);border-radius:12px}.document-kind{padding:.35rem .5rem;border-radius:8px;background:var(--blue-soft);color:var(--blue-deep);font-size:.75rem;font-weight:800}.system-grid{display:grid;gap:14px}.system-card{padding:18px}
@media(max-width:900px){.new-analysis-grid,.result-layout,.result-hero{grid-template-columns:1fr}.map{height:400px}.metric-grid{grid-template-columns:1fr}.method-note{display:none}.main-nav{display:none}.section-body{padding-left:0}.section-number{display:none}}
@media(max-width:600px){:root{--shell:calc(100vw - 24px)}.app-main{padding-top:26px}.page-heading h1,.builder-heading h1{font-size:2rem}.address-row{grid-template-columns:1fr}.map{height:340px}.selected-point{display:grid}.gallery,.map-gallery{grid-template-columns:1fr 1fr}}

.captcha-text-row{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:12px}
.captcha-text-input{min-width:0;padding:.78rem .85rem;border:1px solid var(--line-strong);border-radius:11px;background:#fff;color:var(--ink)}
@media(max-width:600px){.captcha-text-row{grid-template-columns:1fr}}

[hidden]{display:none!important}
.item-meta,.gallery-meta{margin:0 0 5px;color:var(--muted);font-size:.76rem;font-weight:650}
.timeline-item .item-meta{padding-right:8px}
.section-empty{padding:18px;border:1px dashed var(--line-strong);border-radius:12px;color:var(--muted);background:var(--surface-tint)}
.source-status-row.source-error{background:var(--red-soft)}
.source-status-row.source-empty{opacity:.72}
.source-status-row.source-ok strong:last-child{color:var(--green)}

.result-map{height:440px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#eef2f7}
.result-map .leaflet-popup-content{font-family:Inter,"Segoe UI Variable","Segoe UI",Arial,sans-serif;line-height:1.4}
@media(max-width:900px){.result-map{height:360px}}

.progress-card{margin-bottom:20px}
.progress-card .visual-card-head{display:flex;justify-content:space-between;align-items:center;gap:16px}
.source-status-row.source-working{background:var(--blue-soft)}
.source-status-row.source-working strong:last-child{color:var(--blue-deep)}

.export-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:16px}
.link-button{display:inline-flex;align-items:center;text-decoration:none}

.history-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.history-delete{border:0;background:transparent;color:var(--muted);font:inherit;font-size:.78rem;font-weight:700;cursor:pointer;padding:6px}
.history-delete:hover{color:#a83a3a}
.history-delete:disabled{opacity:.45;cursor:default}
@media(max-width:600px){.history-actions{justify-content:flex-start}}

.gallery-rights{margin:4px 0 8px;color:var(--muted);font-size:.74rem;line-height:1.35}

.source-status-row.source-blocked{background:#fff7df}
.source-status-row.source-blocked strong:last-child{color:#9a6b00}
.source-check-card{margin-top:18px}
.system-check-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px}
@media(max-width:700px){.system-check-head{display:grid}.system-check-head button{width:100%}}

.document-links{display:flex;align-items:center;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.document-links a:last-child:not(:first-child){padding:.28rem .46rem;border:1px solid var(--line);border-radius:8px;background:var(--surface-tint)}
@media(max-width:600px){.document-row{grid-template-columns:auto 1fr}.document-links{grid-column:1/-1;justify-content:flex-start}}

.result-quality-note{margin-top:14px;padding:11px 13px;border-radius:11px;font-size:.86rem;line-height:1.45;font-weight:650}
.result-quality-note.partial{background:#fff7df;color:#7b5700;border:1px solid #efd98c}
.result-quality-note.error{background:var(--red-soft);color:var(--red);border:1px solid #efb9b9}


.analysis-heading h1{max-width:980px;font-size:clamp(1.9rem,3.2vw,2.8rem);overflow-wrap:anywhere}
.selected-coordinates{display:grid;justify-items:end;align-content:center}
.selected-coordinates span{display:block;color:var(--muted);font-size:.75rem}
.selected-coordinates code{color:var(--blue-deep)}
@media(max-width:600px){.selected-coordinates{justify-items:start}}
