/* ---------- casca ---------- */
.skip { position: absolute; left: -9999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: var(--radius); z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--text-3); }
.fine { color: var(--text-3); font-size: 12px; margin: 16px 0 0; }

/* Marca: bússola + TERRAYIELD em serifa, como nos documentos da TerraYield Co */
.brand-mark { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-glyph { width: 26px; height: 27px; flex: none; display: block; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-word b { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; }
.brand-word small { font-size: 10.5px; color: #C9D6CC; letter-spacing: 0.02em; margin-top: 3px; font-weight: 400; }
.brand-mark.lg { gap: 16px; }
.brand-mark.lg .brand-glyph { width: 46px; height: 48px; }
.brand-mark.lg .brand-word b { font-size: 32px; }
.brand-mark.lg .brand-word small { font-size: 13px; margin-top: 6px; }

.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 28px; padding: 0 20px; background: var(--ty-forest); border-bottom: 2px solid var(--ty-gold); color: #fff; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: var(--radius); color: #D9E3DB; text-decoration: none; font-weight: 700; font-size: 14px; min-height: 40px; display: inline-flex; align-items: center; box-shadow: inset 0 -2px 0 transparent; border-radius: 0; }
.topnav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.topnav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--ty-gold); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user { color: #D9E3DB; font-size: 14px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #D9E3DB; cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--ty-gold); }
.topbar .btn-ghost { color: #fff; }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.1); }
.topbar :focus-visible { outline-color: var(--ty-gold); }
#main { outline: none; }

.page { max-width: 1200px; margin: 0 auto; padding: 28px 20px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head p { margin: 4px 0 0; color: var(--text-3); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 20px; }
.notice { padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.warn { color: var(--st-warn); background: var(--st-warn-bg); border-color: #E9D79A; }
.notice.fail { color: var(--st-fail); background: var(--st-fail-bg); border-color: #EBC2BE; }
.notice.info { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.empty { text-align: center; padding: 48px 16px; color: var(--text-3); }
.empty h2 { color: var(--text); font-size: 18px; margin-bottom: 8px; }

/* ---------- login ---------- */
.login-page { background: var(--surface); }
.login-wrap { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.login-brand {
  position: relative; overflow: hidden; color: #D9E3DB; padding: clamp(24px, 5vh, 48px) clamp(32px, 4.5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between; gap: clamp(16px, 4vh, 40px);
  background: radial-gradient(120% 90% at 85% 10%, #1F3D2B 0%, var(--ty-forest) 60%);
}
.login-brand::before { content: ""; position: absolute; inset: 0; background: url("../img/topo.svg") center / cover no-repeat; pointer-events: none; }
.login-brand > * { position: relative; }
.login-hero { display: grid; gap: clamp(12px, 2.4vh, 20px); max-width: 500px; }
.login-rule { width: 56px; height: 3px; background: var(--ty-gold); border: 0; margin: 0; }
.login-claim { font-family: var(--font-display); font-size: clamp(22px, min(2vw, 3.6vh), 30px); line-height: 1.25; color: #fff; margin: 0; letter-spacing: -0.005em; }
.login-steps { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 0; border-top: 1px solid rgba(255,255,255,0.12); }
.login-steps li { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: clamp(7px, 1.4vh, 12px) 0; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 14px; }
.login-steps b { color: var(--ty-gold); font-weight: 700; letter-spacing: 0.02em; }
.login-steps span { color: #D9E3DB; }
.login-sources span { display: block; color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.login-sources p { margin: 0; color: #A9BBAE; font-size: 12.5px; line-height: 1.55; max-width: 520px; }
.login-card { background: var(--surface); padding: clamp(24px, 5vh, 48px) clamp(32px, 4.5vw, 64px) clamp(16px, 3vh, 28px); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; }
.login-box { width: 100%; max-width: 380px; margin: auto 0; }
.login-mark-sm { width: 32px; height: 34px; display: block; margin-bottom: clamp(10px, 2vh, 18px); }
.login-card h1 { font-size: clamp(22px, 3.4vh, 28px); letter-spacing: -0.005em; }
.login-sub { color: var(--text-3); margin: 4px 0 0; font-size: 14px; }
.login-card form { display: grid; gap: clamp(10px, 2vh, 16px); margin-top: clamp(14px, 3vh, 24px); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 42px; min-height: 44px; }
.input-icon .input::placeholder { color: #9AA39D; }
.input-icon .input[type="password"], .input-icon .input#password { padding-right: 84px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 10px;
  border: 0; background: transparent; color: var(--ty-forest); font-size: 13px; font-weight: 700; cursor: pointer; border-radius: 4px;
}
.pw-toggle:hover { background: var(--surface-2); }
.btn-lg { min-height: 46px; font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.login-card .field-error { background: var(--st-fail-bg); border: 1px solid #EBC2BE; border-radius: var(--radius); padding: 8px 12px; margin: 0; }
.login-secure { display: flex; gap: 8px; align-items: flex-start; color: var(--text-3); font-size: 12.5px; margin: clamp(12px, 2.4vh, 20px) 0 0; padding-top: clamp(10px, 2vh, 16px); border-top: 1px solid var(--border); }
.login-secure svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ty-sage); }
.login-card .fine { margin: 0; align-self: center; }
.login-page .brand-mark.lg .brand-glyph { width: 40px; height: 42px; }
.login-page .brand-mark.lg .brand-word b { font-size: 26px; }
.login-page .brand-mark.lg .brand-word small { font-size: 12px; margin-top: 4px; }
.login-page .field label { font-size: 13.5px; }
@media (max-height: 700px) and (min-width: 761px) {
  .login-mark-sm, .login-sources p { display: none; }
  .login-steps li { font-size: 13.5px; }
}
@media (max-height: 560px) and (min-width: 761px) {
  .login-steps { display: none; }
}
.btn-block { width: 100%; min-height: 44px; }

/* ---------- carteira ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th button:focus-visible { outline: 3px solid var(--focus); }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { cursor: pointer; transition: background 120ms var(--ease); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; }
.score-cell { font-weight: 700; font-size: 16px; }
.name-cell strong { display: block; }
.name-cell small { color: var(--text-3); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-soft); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { padding: 16px; }
.kpi { border-top: 3px solid var(--ty-gold); }
.kpi .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--ty-forest); }
.kpi .l { color: var(--text-3); font-size: 13px; }

/* ---------- nova análise ---------- */
.split { display: grid; grid-template-columns: 420px 1fr; gap: 20px; align-items: start; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; min-height: 44px; cursor: pointer; color: var(--text-2); font-weight: 550; }
.tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row .field { flex: 1; }
.preview-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
.preview-facts div { display: flex; flex-direction: column; }
.preview-facts span { font-size: 12px; color: var(--text-3); }
.preview-facts strong { font-size: 15px; }
.map-box { height: 560px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; background: var(--surface-3); }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-2); cursor: pointer; }
.dropzone > svg { width: 28px; height: 28px; display: block; margin: 0 auto 6px; color: var(--primary); }
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- análise ---------- */
.analysis { display: grid; grid-template-columns: minmax(420px, 540px) 1fr; height: calc(100dvh - var(--topbar-h)); }
.panel { overflow-y: auto; border-right: 1px solid var(--border); padding: 20px 22px 40px; display: flex; flex-direction: column; gap: 18px; }
.panel > * { flex-shrink: 0; }
.analysis .map-area { position: relative; }
.analysis .map-area .map { position: absolute; inset: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-size: 14px; min-height: 32px; }
.back svg { width: 16px; height: 16px; }
.prop-head h1 { font-size: 22px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 14px; margin-top: 6px; }
.meta b { color: var(--text); font-weight: 600; }

.gate0 { padding: 18px; display: grid; gap: 14px; }
.gate-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gate-title h2 { font-size: 15px; color: var(--text-2); font-weight: 600; }
.score-row { display: flex; align-items: center; gap: 18px; }
.score-big { font-family: var(--font-display); font-size: 52px; font-weight: 700; line-height: 1; color: var(--ty-forest); }
.score-big small { font-size: 18px; color: var(--text-3); font-weight: 500; }
.verdict { display: flex; flex-direction: column; gap: 4px; }
.verdict .v { font-size: 18px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.verdict .v .dot { width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
.verdict .h { color: var(--text-2); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dim { padding: 10px; border-radius: var(--radius); background: var(--surface-2); }
.dim span { display: block; font-size: 12px; color: var(--text-3); }
.dim strong { font-size: 16px; }
.dim strong.neg { color: var(--st-fail); }

.section-title { font-size: 14px; font-weight: 650; color: var(--text); margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.section-title small { font-weight: 500; color: var(--text-3); }
.crit-group { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.crit-group > h3 { font-size: 13px; padding: 8px 12px; background: var(--surface-2); color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--border); }
.crit { border-bottom: 1px solid var(--border); }
.crit:last-child { border-bottom: 0; }
.crit > button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 12px; cursor: pointer; min-height: 48px; }
.crit > button:hover { background: var(--surface-2); }
.crit > button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.crit .t { font-weight: 600; font-size: 14px; }
.crit .s { display: block; color: var(--text-2); font-size: 13px; font-weight: 400; margin-top: 2px; }
.crit .ded { font-weight: 700; font-size: 14px; min-width: 40px; text-align: right; }
.crit .ded.zero { color: var(--text-3); font-weight: 500; }
.crit .chev { width: 16px; height: 16px; color: var(--text-3); transition: transform 150ms var(--ease); }
.crit[data-open="true"] .chev { transform: rotate(90deg); }
.crit .body { display: none; padding: 0 12px 12px; font-size: 13px; color: var(--text-2); }
.crit[data-open="true"] .body { display: block; }
.findings { width: 100%; border-collapse: collapse; margin: 6px 0 8px; }
.findings td, .findings th { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: left; font-size: 12.5px; }
.findings th { color: var(--text-3); font-weight: 600; }
.findings td.num { text-align: right; white-space: nowrap; }
.src-line { color: var(--text-3); font-size: 12px; }
.docs-opts { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.docs-opts label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; min-height: 40px; }
label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.docs-opts input { accent-color: var(--primary); }
.docs-opts label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.sources { display: grid; gap: 4px; }
.source { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 6px 2px; }
.source .ic { width: 14px; height: 14px; }
.source .ok-ic { width: 10px; height: 10px; border-radius: 50%; background: var(--st-ok); margin-left: 2px; }
.source .bad-ic { width: 10px; height: 10px; border-radius: 2px; background: var(--st-fail); margin-left: 2px; }
.source .n { color: var(--text-3); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); transition: width 300ms var(--ease); }

.gate1 { padding: 18px; display: grid; gap: 12px; }
.gate1.locked { color: var(--text-3); }
.g1-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ind { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ind:last-child { border-bottom: 0; }
.ind .p { font-weight: 700; }
.ind .s { grid-column: 1 / -1; color: var(--text-3); }
.checklist { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.map-tools { position: absolute; top: 12px; left: 12px; z-index: 5; display: flex; flex-direction: column; gap: 8px; max-width: 300px; }
.map-tools .card { padding: 10px 12px; font-size: 13px; }
.basemap { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-1); }
.basemap button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-weight: 550; font-size: 13px; min-height: 40px; }
.basemap button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.legend { display: grid; gap: 6px; }
.legend label { display: grid; grid-template-columns: 16px 14px 1fr; gap: 6px; align-items: center; cursor: pointer; }
.legend .sw { width: 14px; height: 10px; border-radius: 2px; }
.legend input { accent-color: var(--primary); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow-2); z-index: 50; font-size: 14px; }

/* ---------- responsivo ---------- */
@media (max-width: 1024px) {
  .analysis { grid-template-columns: 1fr; height: auto; }
  .analysis .map-area { height: 60vh; order: -1; }
  .panel { border-right: 0; overflow: visible; }
  .split { grid-template-columns: 1fr; }
  .map-box { height: 420px; }
}
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 20px; gap: 24px; }
  .login-steps, .login-sources { display: none; }
  .login-claim { font-size: 22px; }
  .login-card { padding: 32px 20px 24px; }
  .login-mark-sm { display: none; }
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar .user, .switch span { display: none; }
  .topnav a { white-space: nowrap; padding: 8px; font-size: 14px; }
  .brand-word b { font-size: 15px; }
  .topbar .brand-word small { display: none; }
  .brand-mark.lg .brand-word b { font-size: 24px; }
  .switch { display: none; }
  .topbar-right { gap: 4px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dims { grid-template-columns: repeat(2, 1fr); }
  .g1-row { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 40px; }
  .panel { padding: 16px; }
  .preview-facts { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
}

/* ---------- leitura assistida da matrícula ---------- */
.mat-lead { margin: 0 0 8px; color: var(--text); font-size: 14.5px; }
.mat-hint { margin: 0 0 12px; color: var(--text-3); font-size: 13px; }
.mat-q { margin: 14px 0 10px; font-weight: 700; }
.mat-drop {
  display: flex; align-items: center; gap: 14px; padding: 18px; margin-bottom: 10px; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
.mat-drop:hover, .mat-drop:focus-within { border-color: var(--primary); background: var(--primary-soft); }
.mat-drop > svg { width: 26px; height: 26px; color: var(--primary); flex: none; }
.mat-drop span { display: flex; flex-direction: column; gap: 2px; }
.mat-drop small { color: var(--text-3); font-size: 13px; }
.mat-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.mat-steps li::marker { color: var(--ty-gold); font-weight: 700; }

/* ---------- explicações do modo apresentação ---------- */
.explain { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--ty-gold); background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.explain > summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.explain[open] > summary { margin-bottom: 6px; }
.explain:not([open]) { padding-top: 8px; padding-bottom: 8px; }
.explain p { margin: 0 0 6px; }
.explain p:last-child { margin-bottom: 0; }

/* ---------- documentos opcionais do imóvel ---------- */
.doc-pick { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.doc-pick > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.doc-count { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.doc-rows { display: grid; gap: 6px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.doc-row.on { border-color: var(--st-ok); background: var(--st-ok-bg); }
.doc-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.doc-what b { font-size: 14px; }
.doc-what small { font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.doc-what small.doc-file { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-what small.doc-file.bad { color: var(--st-fail); white-space: normal; }
.doc-row .btn { flex: none; cursor: pointer; }
.doc-state { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.doc-state.ok { color: var(--st-ok); font-weight: 700; }
.doc-card { margin: 0 0 6px 14px; padding: 8px 12px; border: 1px solid var(--border); border-left: 3px solid var(--ty-gold); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); }
.doc-card > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; }
.doc-card > summary span:first-child { display: flex; flex-direction: column; min-width: 0; }
.doc-card > summary b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card > summary small { font-size: 12px; color: var(--text-3); }
@media (max-width: 640px) {
  .doc-row { flex-wrap: wrap; }
  .doc-what { flex-basis: 100%; }
}

/* ---------- ID Social ---------- */
.social-rows { margin: 4px 0 2px; padding-left: 18px; font-size: 12.5px; color: var(--text-2); display: grid; gap: 2px; }

/* ---------- indicador de espera (etapa, tempo decorrido, estimativa) ---------- */
.wait { padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--ty-gold); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface-2); text-align: left; }
.wait-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.wait-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-count { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.wait-time { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wait .progress { margin: 8px 0 6px; }
.wait-bar { transition: width 500ms linear; }
.wait.slow .wait-bar { background: var(--st-warn); }
.wait-step { font-size: 13.5px; color: var(--text); min-height: 1.4em; }
.wait-hint { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.wait .btn { margin-top: 8px; }
.wait-line { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.dropzone .wait { cursor: default; }

/* ---------- nova análise: localização, documentos agrupados e identificação ---------- */
.split.wide { grid-template-columns: minmax(460px, 620px) 1fr; }
.split.wide .map-box { position: sticky; top: calc(var(--topbar-h) + 16px); height: calc(100vh - var(--topbar-h) - 48px); min-height: 420px; }
.step-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 4px; }
#loc-card .tabs { flex-wrap: wrap; }
.step-head h2 { font-size: 18px; margin: 0; }
.step-tag { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.step-tag.req { color: var(--ty-gold-ink, #8a6d0a); }
.step-head .doc-count, .step-head .loc-state { margin-left: auto; }
.loc-state { font-size: 12.5px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.loc-state.ok { color: var(--st-ok); }
section.doc-pick { border: 1px solid var(--border); padding: 20px; }
.doc-meter { margin-top: 6px; height: 4px; }
.doc-meter > div { background: var(--ty-gold); }
.doc-group + .doc-group { margin-top: 16px; }
.doc-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.doc-group-head > div { display: flex; flex-direction: column; }
.doc-group-head b { font-size: 14.5px; }
.doc-group-head small { font-size: 12.5px; color: var(--text-3); }
.doc-group-ic { flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--ty-forest); color: var(--ty-gold); }
.doc-group-ic svg { width: 18px; height: 18px; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.doc-tile { position: relative; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; transition: border-color 150ms var(--ease), background 150ms var(--ease); }
.doc-tile:hover { border-color: var(--border-strong); }
.doc-tile .doc-what b { padding-right: 22px; }
.doc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.doc-check { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center; background: var(--st-ok); color: #fff; }
.doc-check svg { width: 13px; height: 13px; stroke-width: 3; }
.doc-tile.on .doc-check { display: grid; }
.btn-gold { background: var(--ty-gold); border-color: var(--ty-gold); color: var(--ty-forest); font-weight: 700; }
.btn-gold:hover { filter: brightness(1.05); }
.final-hint { font-size: 13px; color: var(--text-3); margin: 0; }
@media (max-width: 1024px) {
  .split.wide { grid-template-columns: minmax(0, 1fr); }
  .split.wide > .stack { min-width: 0; }
  .split.wide .map-box { position: relative; top: 0; height: 320px; min-height: 0; order: -1; }
}
@media (max-width: 560px) {
  .doc-grid { grid-template-columns: 1fr; }
}
.doc-row.doc-tile { flex-wrap: nowrap; }
.doc-row.doc-tile .doc-what { flex: 0 1 auto; }

.doc-what small.doc-auto { color: var(--st-ok); font-weight: 600; }

/* painel estreito da análise: nada pode passar da largura (sem barra horizontal) */
.analysis .panel { overflow-x: hidden; }
.analysis .panel > * { min-width: 0; max-width: 100%; }
#docs-box .doc-row { flex-wrap: wrap; row-gap: 6px; }
#docs-box .doc-what { flex: 1 1 220px; }
#docs-box .doc-state { margin-left: auto; }
.doc-card { min-width: 0; }
.doc-card > summary span:first-child { flex: 1; }
.doc-card .preview-facts strong, .preview-facts strong { overflow-wrap: anywhere; }
.doc-card .findings td { overflow-wrap: anywhere; }
.doc-card .actions { flex-wrap: wrap; }

/* avisos empilhados */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; max-width: calc(100vw - 24px); }
.toasts .toast { position: static; transform: none; left: auto; bottom: auto; }

/* documento lido sem perímetro: motivo e caminho alternativo */
.why > div { display: grid; gap: 6px; min-width: 0; }
.why b { color: var(--text); }
.why p { margin: 0; }
.why-facts { font-size: 13px; color: var(--text-2); }
.why details { font-size: 13px; color: var(--text-2); }
.why details ul { margin: 4px 0 0; padding-left: 18px; }
.why .actions { flex-wrap: wrap; }
