/* Result presentation; DNI virtual and original document contents are excluded. */
.md-query-report .md-section-title { margin: 0; padding: 16px 18px; background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.md-query-report :is(.api-mtc-section,.api-arbol-grupo) { margin-top: 22px; }
.md-query-report :is(.api-record,.api-mtc,.api-pnp,.api-arbol,.api-vehiculo) { min-width: 0; }
.md-query-report :is(.api-vehiculo-grid,.api-arbol-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); }
.md-query-report .api-vehiculo-panel dl > div { min-width: 0; }
.md-query-report .api-vehiculo-panel h4 { font-size: 14px; text-transform: none; letter-spacing: 0; }
.md-query-report .api-vehiculo-panel dt { font-size: 12px; font-weight: 500; }
.md-query-report .api-vehiculo-panel dd { font-size: 14px; font-weight: 600; line-height: 1.5; }
.md-query-report .api-vehiculo-grid + .md-report-section { margin: 0 18px 18px; }
.md-query-report .api-vehiculo-panel :is(dt,dd) { overflow-wrap: anywhere; }
.md-query-report .md-family-record { margin: 0; align-self: start; }
.md-family-record summary small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); margin-top: 6px; }
.md-query-report .api-record-data { grid-template-columns: minmax(110px,32%) minmax(0,1fr); }
.md-query-report .api-record-data dd { margin: 0; }
.md-document-report { min-width: 0; max-width: 100%; }
.md-document-report :is(.api-pdf-header,.consulta-archivo-titulo) { gap: 12px; flex-wrap: wrap; }
.md-document-report :is(strong,figcaption,.consulta-archivo-meta) { min-width: 0; overflow-wrap: anywhere; }
.md-document-report :is(.api-pdf-download,.md-result-download) { min-width: 44px; min-height: 44px; }
.consulta-imagen:has(.md-attachment-download) { min-width: 0; cursor: default; }
.consulta-imagen .md-source-image-open { display: block; width: 100%; }
.consulta-imagen figcaption:has(.md-attachment-download) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.md-attachment-download { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.md-attachment-download:hover { background: var(--bg-soft); }
.identity-detail-records { padding: 12px; display: grid; gap: 12px; }
.identity-detail-record { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.identity-detail-record > summary { display: flex; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; font-size: 14px; font-weight: 650; background: var(--muted); overflow-wrap: anywhere; }
.identity-detail-record > summary span { margin-left: auto; color: var(--muted-foreground); font-size: 11px; white-space: nowrap; }
.identity-detail-record > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.identity-detail-record .identity-info-fields dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.md-query-report { min-width: 0; color: var(--ink); line-height: 1.5; }
.md-query-report *, .md-query-report *::before { box-sizing: border-box; }
.md-query-report :is(h3,h4,p,dd,td,dt,summary) { overflow-wrap: anywhere; }
.md-report-heading { padding: 0 0 24px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.md-report-eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.md-report-heading h3 { margin: 8px 0 4px; font-size: clamp(20px, 2.1vw, 28px); line-height: 1.25; font-weight: 700; }
.md-report-heading p { margin: 0; font-size: 13px; color: var(--ink-3); }
.md-identity-layout { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 28px; align-items: start; }
.md-identity-layout:not(.has-media) { grid-template-columns: minmax(0,1fr); }
.md-soat-report > .api-fields { margin-bottom: 18px; }
.md-identity-sections, .md-identity-media, .md-identity-biometrics { display: grid; gap: 16px; min-width: 0; }
.md-identity-media .api-photo, .md-identity-media .api-firma { width: 100%; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.md-identity-media :is(.api-photo,.api-firma) figcaption { margin: 0 0 10px; color: var(--ink-3); text-align: left; font-size: 12px; font-weight: 650; }
.md-identity-media .api-photo .api-img-wrap { aspect-ratio: 3/4; }
.md-identity-media .api-photo img { width: 100%; height: 100%; object-fit: contain; }
.md-identity-media .api-firma .api-img-wrap { height: auto; min-height: 80px; }
.md-identity-media .api-firma img { width: 100%; max-height: 150px; object-fit: contain; }
.md-query-report .md-report-section { margin: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; min-width: 0; }
.md-query-report .md-report-section + .md-report-section { margin-top: 14px; }
.md-identity-sections > .md-report-section + .md-report-section { margin-top: 0; }
.md-query-report .md-report-section > summary, .md-query-report .api-block > summary { display: flex; gap: 12px; align-items: center; padding: 15px 18px; cursor: pointer; list-style: none; background: var(--bg-soft); font-size: 14px; font-weight: 700; }
.md-query-report summary::-webkit-details-marker { display: none; }
.md-query-report .md-report-section > summary::after, .md-query-report .api-block > summary::after, .md-record > summary::after { content: ''; flex: 0 0 7px; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.md-query-report details[open] > summary::after { transform: rotate(225deg); }
.md-query-report summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.md-section-count { padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.md-query-report .md-section-body { padding: 16px; }
.md-query-report .md-report-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; padding: 6px 18px 12px; gap: 0 24px; }
.md-report-fields > div { min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.md-report-fields dt { font-size: 12px; color: var(--ink-3); margin: 0 0 4px; }
.md-report-fields dd { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.md-query-report .api-block { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); }
.md-query-report .api-pretty { padding: 18px; }
.md-query-report > .api-block { border: 0; border-radius: 0; background: transparent; }
.md-query-report > .api-block > summary { padding: 0 0 16px; background: transparent; border-bottom: 1px solid var(--line); }
.md-query-report > .api-block > .api-pretty { padding: 16px 0 0; }
.md-query-report .api-fields { border-radius: 10px; background: var(--bg); }
.md-query-report .api-field { grid-template-columns: minmax(120px,32%) minmax(0,1fr); padding: 12px 16px; gap: 16px; }
.md-query-report .api-field-k { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.md-query-report .api-field-v { font-size: 14px; font-weight: 600; white-space: pre-wrap; }
.md-query-report .api-table-wrap { max-width: 100%; }
.md-query-report :is(.api-data-table,.api-table) { width: 100%; min-width: 0; font-size: 13px; border-collapse: collapse; }
.md-query-report :is(.api-data-table,.api-table) th { background: var(--bg-soft); color: var(--ink-3); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.md-query-report :is(.api-data-table,.api-table) :is(th,td) { padding: 12px 16px; text-align: left; vertical-align: top; white-space: normal; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.md-query-report :is(.api-data-table,.api-table) tbody tr:nth-child(even) { background: var(--bg-soft); }
.md-query-report .api-data-table .api-img-wrap { max-width: 100px; }
.md-query-report .api-data-table img { max-width: 100%; }
.md-record-count { margin: 0 0 12px; color: var(--ink-3); font-size: 12px; }
.md-record { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.md-record:last-child { margin-bottom: 0; }
.md-record > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 650; }
.md-record-hint { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.md-record[open] > summary .md-record-hint { visibility: hidden; }
.md-record-body { padding: 0 16px 16px; }
.md-query-report .consulta-datos-registro { padding: 0; margin: 12px; }
.md-query-report .consulta-datos-registro dl { margin: 0 14px 14px; background: var(--line); }
.md-query-report .consulta-datos-registro dl > div { padding: 12px; background: var(--bg); }
.md-query-report .consulta-datos-registro dt { text-transform: none; font-size: 12px; letter-spacing: normal; font-weight: 500; }
.md-query-report .consulta-datos-registro dd { font-size: 14px; }
.md-query-report .consulta-resultado-head { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) {
  .md-identity-layout { grid-template-columns: minmax(0,1fr) 190px; gap: 18px; }
  .md-query-report .md-report-fields { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .md-query-report :is(.api-vehiculo-grid,.api-arbol-grid,.api-record-data) { grid-template-columns: minmax(0,1fr); }
  .md-query-report .api-record-data { gap: 4px; }
  .md-query-report .api-record-data dd { margin-bottom: 12px; }
  .md-query-report .api-vehiculo-title strong { font-size: 20px; overflow-wrap: anywhere; }
  .md-query-report :is(.api-vehiculo-hero,.api-pnp-head,.api-record-head) { flex-wrap: wrap; }
  .md-query-report .api-vehiculo-panel { padding: 14px; }
  .md-query-report .api-vehiculo-panel dl > div { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .md-document-report .consulta-archivo-meta { flex: 1 1 180px; }
  .identity-result-dialog .identity-table-scroll { overflow: visible; }
  .identity-result-dialog .identity-table-scroll table { display: block; min-width: 0; width: 100%; }
  .identity-result-dialog .identity-table-scroll thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .identity-result-dialog .identity-table-scroll tbody { display: grid; gap: 12px; }
  .identity-result-dialog .identity-table-scroll tr { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; }
  .identity-result-dialog .identity-table-scroll td { display: block; padding: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
  .identity-result-dialog .identity-table-scroll td::before { content: attr(data-label); display: block; color: var(--muted-foreground); font-size: 11px; margin-bottom: 3px; }
  .md-report-heading { padding-bottom: 18px; margin-bottom: 18px; }
  .md-identity-layout { grid-template-columns: minmax(0,1fr); }
  .md-identity-media { grid-template-columns: minmax(0,1fr); }
  .md-identity-media .api-photo { max-width: 220px; justify-self: center; }
  .md-identity-biometrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .md-identity-biometrics > :first-child { grid-column: 1/-1; }
  .md-query-report .api-pretty, .md-query-report .md-section-body { padding: 12px; }
  .md-query-report .api-field { grid-template-columns: minmax(0,1fr); gap: 4px; padding: 12px; }
  .md-query-report .md-report-section > summary, .md-query-report .api-block > summary { padding: 14px; }
  .md-query-report .md-report-fields { padding: 4px 14px 12px; }
  .md-query-report .md-responsive-table { display: block; }
  .md-query-report .md-responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .md-query-report .md-responsive-table tbody { display: grid; gap: 12px; }
  .md-query-report .md-responsive-table tr { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg) !important; }
  .md-query-report .md-responsive-table td { display: block; padding: 8px 0; font-size: 14px; }
  .md-query-report .md-responsive-table td::before { content: attr(data-label); display: block; color: var(--ink-3); font-size: 11px; font-weight: 500; margin-bottom: 3px; }
  .md-query-report .md-responsive-table td:last-child { border-bottom: 0; }
  .md-query-report .api-table-wrap:has(.md-responsive-table) { border: 0; border-radius: 0; overflow: visible; }
  .md-query-report .consulta-datos-registro dl { grid-template-columns: 1fr; }
  .md-record-body { padding: 0 10px 12px; }
}

/* Record indexes: summary first, originals and full details on demand. */
.md-name-results{min-width:0}.md-name-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 0}.md-name-heading h3{margin:0;font-size:16px}.md-name-heading>span{color:var(--ink-3);font-size:13px;white-space:nowrap}.md-name-table-wrap{max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:10px}.md-name-table{width:100%;border-collapse:collapse;font-size:13px}.md-name-table th{padding:12px;text-align:left;background:var(--bg-soft);font-size:12px;color:var(--ink-3)}.md-name-table td{padding:12px;border-top:1px solid var(--line);vertical-align:top;overflow-wrap:anywhere}.md-name-table td[data-label="DNI"]{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}
@media(max-width:760px){.md-name-heading{align-items:flex-start}.md-name-table-wrap{border:0;overflow:visible}.md-query-report table.md-name-table tbody{gap:10px}.md-query-report table.md-name-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 14px;padding:14px}.md-query-report table.md-name-table td{padding:0;min-width:0;border:0}.md-query-report table.md-name-table td[data-label="Ubigeo"]{grid-column:1/-1}}
.md-source-image-open{display:inline-flex;align-items:center;justify-content:center;max-width:100%;padding:0;border:0;background:transparent;cursor:zoom-in}.md-source-image-open:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.md-source-image-open img{max-width:100%}button.api-img-wrap{padding:0;border:0;background:transparent;font:inherit;color:inherit}.md-record-state{color:var(--ink)!important}
.md-record-overview{display:grid;gap:7px;flex:1;min-width:0}.md-record-summary{display:flex;flex-wrap:wrap;gap:6px 18px;font-weight:400;line-height:1.5}.md-record-summary small{color:var(--ink-3);margin-right:4px}
.md-case-index{border:1px solid var(--line);border-radius:14px;background:var(--bg);overflow:hidden;min-width:0;width:100%;color:var(--ink)}
.md-index-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 22px;border-bottom:1px solid var(--line)}
.md-index-heading>div{display:flex;align-items:center;gap:12px;min-width:0}.md-index-heading img{width:32px;height:38px;object-fit:contain}.md-index-heading h3{font-family:inherit;font-size:17px;font-weight:600;line-height:1.4;margin:0}.md-index-heading h3 span{display:inline-grid;place-items:center;min-width:26px;padding:2px 8px;margin-left:8px;border-radius:20px;background:var(--bg-soft);border:1px solid var(--line);font-size:12px}
.md-index-heading button,.md-inline-pdf button,.md-inline-pdf a,.md-case-actions>a,.md-case-actions>button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:38px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font-family:inherit;font-size:12px;font-weight:600;line-height:1.3;text-decoration:none;white-space:nowrap;cursor:pointer}
.md-index-heading button{background:var(--accent);color:var(--accent-ink,#fff);border-color:var(--accent)}
.md-index-heading button:disabled{opacity:.55;cursor:wait}.md-inline-pdf button:hover,.md-inline-pdf a:hover{background:var(--bg-soft)}
.md-case-table{width:100%;border-collapse:collapse;font-size:13px;table-layout:auto}.md-case-table th{padding:12px 18px;background:var(--bg-soft);text-align:left;font-weight:600;color:var(--ink-3);font-size:11px;letter-spacing:.02em}.md-case-table td{padding:16px 18px;border-bottom:1px solid var(--line);vertical-align:middle;overflow-wrap:anywhere}.md-case-table th:first-child,.md-case-table td:first-child{width:42px}.md-case-table [data-complaint-row]{cursor:pointer}.md-case-table [data-complaint-row]:hover{background:var(--bg-soft)}
.md-case-title{display:grid;gap:5px;width:100%;text-align:left;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;line-height:1.5}.md-case-title small{color:var(--ink-3);font-size:11px;font-weight:400}.md-case-title strong{font-size:13px;font-weight:650}.md-case-title>span{font-size:11px;color:var(--accent)}
.md-index-number{display:grid;place-items:center;width:27px;height:27px;border:1px solid var(--line);border-radius:50%;font-size:12px;font-weight:600}.md-case-key{font-variant-numeric:tabular-nums;padding:4px 7px;border:1px solid var(--line);border-radius:5px;display:inline-block;font-size:12px;white-space:nowrap}
.md-case-actions{display:flex;flex-wrap:wrap;gap:7px}.md-inline-pdf.md-document-card{display:inline-flex;flex-wrap:wrap;gap:6px;border:0;border-radius:0;overflow:visible;background:transparent}.md-file-unavailable,.md-index-notice{color:var(--ink-3);font-size:12px;line-height:1.5}.md-index-notice{margin:0;padding:14px 22px}.md-case-detail[hidden]{display:none!important}.md-case-detail>td{background:var(--bg-soft);padding:20px!important}.md-case-detail h4{margin:0 0 16px}.md-case-detail dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.md-case-detail dl>div{min-width:0}.md-case-detail dt{font-size:12px;color:var(--ink-3)}.md-case-detail dd{margin:5px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.md-shared-pdfs{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:16px 22px;border-bottom:1px solid var(--line)}
.md-case-index :is(button,a):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.md-case-status{display:inline-block;padding:4px 8px;border:1px solid var(--line);border-radius:6px;background:var(--bg-soft);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.md-case-index+.md-case-index{margin-top:20px}.md-index-context{padding:16px 22px;border-bottom:1px solid var(--line);min-width:0}.md-index-context>summary{cursor:pointer;font-size:13px;font-weight:600}.md-index-context[open]>summary{margin-bottom:14px}.md-case-key{white-space:normal;overflow-wrap:anywhere}.md-case-table th{overflow-wrap:anywhere}
@media(min-width:761px){.md-index-wide th,.md-index-wide td{padding:14px 10px}.md-index-wide th{overflow-wrap:normal}.md-index-wide td[data-label="Fecha"]{min-width:88px}.md-index-wide td[data-label="Importe"]{min-width:64px}.md-index-wide td:first-child{width:36px}}
@media(max-width:760px){
 .md-index-heading{padding:16px;align-items:flex-start;flex-wrap:wrap}.md-index-heading h3{font-size:16px}.md-case-table,.md-case-table tbody{display:block}.md-case-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.md-case-table tbody{padding:12px;display:grid;gap:12px}.md-case-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--line);border-radius:10px;padding:12px;gap:12px}.md-case-table td{padding:0;border:0;display:block;min-width:0}.md-case-table td::before{content:attr(data-label);display:block;font-size:11px;color:var(--ink-3);margin-bottom:5px}.md-case-table td:first-child{width:auto;grid-column:1/-1}.md-case-table td:nth-child(2),.md-case-table td:last-child{grid-column:1/-1}.md-case-table td:first-child::before{display:none}.md-case-title strong{font-size:14px}.md-case-key{white-space:normal}.md-case-detail td{grid-column:1/-1;padding:0!important}.md-case-detail dl{grid-template-columns:1fr}.md-index-notice{padding:14px 16px}.md-case-actions{gap:8px}.md-file-index .md-case-table tr{grid-template-columns:1fr}
}

@media(max-width:760px){.md-query-report table.md-name-table{display:block}.md-query-report table.md-name-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.md-query-report table.md-name-table tbody{display:grid}.md-query-report table.md-name-table td{display:block}.md-query-report table.md-name-table td::before{content:attr(data-label);display:block;color:var(--ink-3);font-size:11px;margin-bottom:3px}}

.dash-form-result:has(> #form-result[hidden]), .dash-form-result:empty { display:none; }
html:root body .md-query-window {
  width: min(960px, calc(100% - 32px)); max-width: none; max-height: 88dvh;
  grid-template-rows: auto minmax(0, 1fr); gap: 0; padding: 0;
  overflow: hidden; background: var(--bg); color: var(--ink); border-radius: 16px;
}
.md-query-window > [data-slot="dialog-header"] {
  padding: 17px 62px 17px 20px; border-bottom: 1px solid var(--line); text-align: left;
}
.md-query-window [data-slot="dialog-title"] { margin: 0; font: inherit; font-size: 18px; font-weight: 600; line-height: 1.4; }
.md-query-window > [data-slot="dialog-close"] { width: 40px; height: 40px; top: 8px; right: 10px; display: grid; place-items: center; }
.md-query-viewport { min-width: 0; min-height: 0; padding: 16px; overflow: auto; overscroll-behavior: contain; }
.md-query-window :is(#form-result,.dash-result-card,.dash-result-body,.md-document-list,.md-inline-result) {
  margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; min-width: 0;
}
.md-query-window .md-document-list > h3, .md-query-window .geo-result-toolbar,
.md-query-window [hidden] { display: none !important; }
.md-query-window .md-document-grid.is-inline { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.md-query-window .consulta-datos-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.md-field-section { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.md-field-section > h4 { margin: 0; padding: 8px 12px; font-size: 13px; background: var(--bg-soft); }
.md-field-section > p { margin: 0; padding: 8px 12px; font-size: 13px; overflow-wrap: anywhere; }
.md-field-list { margin: 0; }
.md-field-list > div { display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); gap: 12px; border-top: 1px solid var(--line); padding: 7px 12px; font-size: 13px; line-height: 1.5; }
.md-field-list :is(dt,dd) { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.md-field-list dt { color: var(--ink-3); }
.md-query-window .consulta-imagenes { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(145px,100%),1fr)); gap: 8px; }
.md-query-window .consulta-imagen { margin: 0; min-width: 0; }
.md-query-window .consulta-imagen button { display: flex; width: 100%; background: var(--bg-soft); border-radius: 8px; }
.md-query-window .consulta-imagen img { width: 100%; height: auto; max-height: 190px; object-fit: contain; }
.md-query-window .consulta-imagen figcaption { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; justify-content: space-between; font-size: 12px; }
.md-query-window .md-attachment-download { font-size: 12px; padding: 4px 8px; }
@media (min-width: 700px) {
  .md-query-window .md-document-grid:has(>[data-result-part="CONSULTA_RESPUESTA"]):has(>[data-result-part="CONSULTA_IMAGENES"]) {
    grid-template-columns: minmax(0, 2fr) minmax(210px, 1fr); align-items: start;
  }
  .md-query-window .md-document-grid:has(>[data-result-part="CONSULTA_IMAGENES"]) > [data-result-part="CONSULTA_RESPUESTA"] { grid-area: 1 / 1; }
  .md-query-window .md-document-grid:has(>[data-result-part="CONSULTA_RESPUESTA"]) > [data-result-part="CONSULTA_IMAGENES"] { grid-area: 1 / 2; }
  .md-query-window .md-document-grid.is-inline > .md-inline-result:not([data-result-part="CONSULTA_RESPUESTA"]):not([data-result-part="CONSULTA_IMAGENES"]) { grid-column: 1 / -1; }
}
@media (max-width: 699px) {
  html:root body .md-query-window { width: calc(100% - 16px); max-height: 92dvh; border-radius: 12px; }
  .md-query-viewport { padding: 10px; }
  .md-query-window [data-result-part="CONSULTA_RESPUESTA"] { order: -1; }
}
@media (min-width: 901px) {
  html:root body.dashboard-page .dash-form[data-svc-form]:has(> .consulta-integrada-field) > .dash-form-actions {
    align-self: flex-start; padding-top: calc(1.55 * 15px + 4px);
  }
}

.md-query-window [data-unified-download] :is(a[download][href],button[data-download-pdf],#geo-download-pdf,[data-download-pdfs]) { display:none !important; }
.md-query-window:has(.md-result-download-area) { grid-template-rows:auto minmax(0,1fr) auto; }
.md-result-download-area { position:relative; display:flex; justify-content:flex-end; padding:4px 14px 10px; }
html:root body .md-result-save-circle {
  display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:50%;
  color:var(--primary-foreground); background:var(--primary); cursor:pointer;
}
.md-result-save-circle:focus-visible, .md-result-files button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.md-result-save-circle:disabled { opacity:.6; cursor:wait; }
.md-result-files { position:absolute; z-index:1; right:14px; bottom:calc(100% + 2px); display:grid; padding:5px; max-height:45dvh; max-width:calc(100% - 28px); overflow:auto; background:var(--bg); border:1px solid var(--line); border-radius:10px; box-shadow:0 5px 20px #0002; }
.md-result-files button { min-height:40px; padding:6px 12px; text-align:left; background:transparent; color:var(--ink); border:0; font:inherit; cursor:pointer; overflow-wrap:anywhere; }
.md-result-files button:hover { background:var(--bg-soft); }
.md-query-window .md-profile-fields { display:table; width:100%; border-collapse:separate; border-spacing:0; table-layout:fixed; overflow:hidden; border:1px solid var(--line); border-radius:9px; font-size:13px; }
.md-profile-fields :is(th,td) { text-align:left; vertical-align:top; padding:6px 10px; overflow-wrap:anywhere; font-weight:400; line-height:1.45; }
.md-profile-fields th:first-child { width:41%; }
.md-profile-fields tbody :is(th,td) { border-top:1px solid var(--line); }
.md-profile-fields thead th { color:var(--ink-3); background:var(--bg-soft); font-size:12px; }
.md-profile-fields tbody th { color:var(--ink-3); }
.md-query-window table.md-profile-fields :is(th,td) { padding:6px 10px; white-space:normal; overflow-wrap:anywhere; line-height:1.45; }
.md-profile-fields + .consulta-respuesta { margin-top:10px; }
.md-query-window [data-unified-download] .consulta-imagen figcaption:has(span[data-fallback-label]) { display:none; }
.md-query-window .md-photo-profile .consulta-imagenes {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:10px;
}
.md-query-window figure[data-profile-media] {
  display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--line);
  border-radius:12px; background:var(--bg); padding:0;
}
.md-query-window figure[data-profile-media] figcaption {
  order:-1; margin:0; padding:7px 11px; border-bottom:1px solid var(--line);
  font-size:13px; font-weight:600; color:var(--ink); background:var(--bg-soft);
}
.md-query-window figure[data-profile-media] .md-source-image-open {
  padding:8px; background:var(--bg);
}
.md-query-window figure[data-profile-media] img { width:100%; max-height:145px; object-fit:contain; }
.md-query-window figure[data-profile-media="foto"] { grid-column:1/-1; order:-2; }
.md-query-window figure[data-profile-media="firma"] { grid-column:1/-1; order:-1; }
.md-query-window figure[data-profile-media="foto"] img { height:clamp(200px,29dvh,340px); max-height:none; }
.md-query-window figure[data-profile-media="firma"] img { max-height:88px; }
.md-query-window .md-photo-profile table.md-profile-fields tbody :is(td,th) {
  font-size:14px; font-weight:400; color:var(--ink); padding:8px 13px;
}
@media (min-width:700px) {
  html:root body .md-query-window:has(.md-photo-profile) { width:min(1100px,calc(100% - 40px)); max-height:92dvh; }
}
@media (max-width:699px) {
  .md-query-window .md-photo-profile [data-result-part="CONSULTA_IMAGENES"] { order:-2; }
  .md-query-window .md-photo-profile .consulta-imagenes { gap:7px; }
  .md-query-window figure[data-profile-media="foto"]:has(~ figure) { grid-column:1; grid-row:span 3; align-self:stretch; }
  .md-query-window figure[data-profile-media="foto"] .md-source-image-open { flex:1; min-height:0; }
  .md-query-window figure[data-profile-media] figcaption { padding:4px 8px; }
  .md-query-window figure[data-profile-media] .md-source-image-open { padding:4px; }
  .md-query-window figure[data-profile-media="foto"] ~ figure { grid-column:2; }
  .md-query-window figure[data-profile-media="foto"] img { height:185px; }
  .md-query-window figure[data-profile-media]:not([data-profile-media="foto"]) img { max-height:52px; }
  .md-query-window .md-photo-profile table.md-profile-fields tbody :is(td,th) { padding:7px 9px; }
}
.md-query-window [data-slot="dialog-title"]:focus { outline:none; }
.md-query-window [data-slot="dialog-header"] .md-query-reference { width:fit-content; margin:4px 0 0; }
.md-query-window:has([data-slot="dialog-header"] .md-query-reference) .md-document-list > .md-query-reference { display:none; }
.md-query-window [data-unified-download] [data-filename-heading] { display:none; }
.md-query-reference {
  display: table;
  margin: 0 0 12px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--bg-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.md-query-reference span { color: var(--ink-3); }
.md-soat-report .md-policy-title { margin: 0 0 8px; font: inherit; font-weight: 600; }
.md-soat-report .md-policy-history { margin-top: 12px; }
.md-policy-history > summary { cursor: pointer; }
.md-policy-history .md-section-body > .md-record-count { display: none; }
.md-inspection-preview { min-width: 0; margin: 0; padding: 10px; }
.md-inspection-preview [data-md-pdf-source] { min-width: 0; }
.md-query-report table.md-result-fields {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-spacing: 0;
  border-collapse: separate;
  border-radius: 9px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
}
.md-query-report .md-result-fields :is(th, td) {
  padding: 7px 12px;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 400;
}
.md-result-fields thead th:first-child { width: 39%; }
.md-result-fields thead th, .md-result-fields th[scope="rowgroup"] { background: var(--bg-soft); }
.md-result-fields thead th { color: var(--ink-3); font-size: 12px; }
.md-query-report .md-result-fields th[scope="rowgroup"] { font-weight: 600; }
.md-result-fields tbody :is(th,td) { border-top: 1px solid var(--line); }
.md-result-fields th[scope="row"] { color: var(--ink-3); }
.md-field-section > table.md-result-fields { border: 0; border-radius: 0; }
.md-fields-with-media { display: grid; align-items: start; gap: 12px; }
.md-fields-with-media > .api-photos { min-width: 0; margin: 0; }
@media (min-width: 761px) {
  .md-fields-with-media { grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr); }
  .md-fields-with-media > .md-result-fields { grid-area: 1 / 1; }
  .md-fields-with-media > .api-photos { grid-area: 1 / 2; }
  html:root body .md-query-window:has(.md-result-fields):not(:has(.md-inline-result ~ .md-inline-result, .api-table-wrap, .md-case-index, .md-fields-with-media, [data-md-pdf-source])) {
    width: min(740px, calc(100% - 32px));
  }
}
.md-query-report .md-wide-records { min-width: 0; overflow-x: auto; }
.md-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.md-section-tabs button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}
.md-section-tabs button[aria-selected="true"] {
  background: var(--bg-soft);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
}
.md-section-tabs button:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.consulta-datos-grid > [role="tabpanel"] { grid-column: 1 / -1; min-width: 0; }
.md-name-table tr[hidden], .consulta-datos-grid [hidden] { display: none !important; }
.md-name-filter { display: grid; gap: 5px; color: var(--ink-3); font-size: 13px; margin: 0 0 10px; }
.md-name-filter input {
  width: min(100%, 26rem);
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
}
@media (min-width: 641px) {
  .md-wide-records th { min-width: 6rem; }
  .md-query-window :is(.md-index-heading, .md-section-title) { padding: 12px 16px; }
  .md-query-window .md-case-table :is(th, td) { padding: 9px 12px; }
}
@media (max-width: 640px) {
  .md-query-report .md-wide-records tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
  .md-query-report .md-wide-records td { min-width: 0; }
  .md-query-report .md-result-fields :is(th,td) { padding: 6px 9px; }
}
.md-inline-file-index .md-document-list > :is(h3,.md-query-reference),
.md-inline-file-index .consulta-archivos > h3 { display:none; }
.md-inline-file-index .md-document-grid.is-inline { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
html:root body .md-pdf-receipt { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 20px; padding:16px 20px; border:1px solid var(--line,#ddd); border-radius:12px; background:var(--card,#fff); color:var(--ink); }
.md-pdf-receipt > div:first-child { min-width:0; }
html:root body .md-pdf-receipt h3 { display:block; margin:0; padding:0; border:0; font-size:16px; }
.md-pdf-receipt p { margin:4px 0 0; color:var(--ink-3); font-size:13px; overflow-wrap:anywhere; }
.md-pdf-receipt-actions,.md-file-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
html:root body :is(.md-pdf-receipt-actions,.md-file-toolbar) > :is(button,a) { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:42px; padding:8px 15px; border:1px solid var(--border,#ddd); border-radius:9px; background:var(--card,#fff); color:var(--foreground,#242424); text-decoration:none; font:inherit; font-weight:600; font-size:13px; cursor:pointer; }
html:root body .md-pdf-receipt-actions [data-open-result],html:root body .md-file-toolbar > a:first-child { background:var(--foreground,#282724); color:var(--card,#fff); }
html:root body :is(.md-receipt-download,.md-file-toolbar .md-pdf-save) { color:white; background:#10794d; border-color:#10794d; }
.md-file-toolbar { margin:0 0 12px; }
.md-pdf-action-notice { font-size:13px; margin:0 0 10px; }
html:root body .md-document-dialog.md-result-pdf { width:min(1180px,calc(100vw - 32px)); max-width:none; max-height:92dvh; }
html:root body .md-document-dialog.md-result-pdf>.md-document-viewport { padding:16px; overflow:auto; }
.md-document-dialog.md-result-pdf .md-pdf-browser-panel .md-pdf-reader .md-pdf-sheet-scroll { height:clamp(170px,calc(90dvh - 220px),900px); }
@media(max-width:600px) {
  html:root body .md-document-dialog.md-result-pdf { width:calc(100vw - 12px); max-height:96dvh; }
  html:root body .md-document-dialog.md-result-pdf>.md-document-viewport { padding:8px; }
  html:root body .md-pdf-receipt { padding:14px; }
  html:root body :is(.md-file-toolbar,.md-pdf-receipt-actions) > :is(button,a) { min-height:44px; padding:7px 10px; }
  .md-file-toolbar { gap:5px; }
}
.md-inline-file-index :is(.dash-result-card,.dash-result-body,.md-document-list,.md-inline-result) { margin:0; padding:0; border:0; background:transparent; box-shadow:none; }
html:root body .md-result-pdf .md-pdf-controls { background:#363636; color:#fff; }
html:root body .md-result-pdf .md-pdf-controls input { background:#252525!important; color:#fff!important; }
.md-result-pdf .md-pdf-controls button:hover:not(:disabled) { background:#505050; }
@media(max-width:600px) {
  .md-file-toolbar { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .md-file-toolbar > :only-child { grid-column:1/-1; }
}
