/* Solo resultado público. La búsqueda y el administrador conservan sus estilos. */
.prt-result-layout, .prt-result-column, .prt-result-sidebar,
.prt-consultation-result, .prt-vehicle-container, .prt-history-container {
  min-width: 0;
  max-width: 100%;
}
#root .prt-result-layout { flex-direction: column; }
.prt-result-layout > .prt-result-column { width: 100%; order: 0; }
.prt-result-layout > .prt-result-sidebar { width: 100%; order: 1; }
.prt-consultation-result .prt-vehicle-container,
.prt-consultation-result .prt-history-container { overflow: visible; }
.prt-consultation-result [hidden] { display: none; }
.prt-consultation-result .prt-vehicle-heading,
.prt-consultation-result .prt-history-heading {
  min-height: 44px;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
}
.prt-consultation-result .prt-vehicle-heading:focus-visible,
.prt-consultation-result .prt-history-heading:focus-visible,
#root .prt-back-to-search:focus-visible { outline: 3px solid #004a99; outline-offset: 3px; }
.prt-consultation-result .prt-vehicle-heading::after { content: '⌃'; margin-left: auto; font-size: 20px; }
.prt-consultation-result .prt-vehicle-heading[aria-expanded='false']::after { content: '⌄'; }
#root .prt-back-to-search { min-height: 44px; padding: 8px 12px; font-size: 14px; }
.prt-consultation-result .prt-vehicle-table,
.prt-consultation-result .prt-history-table { width: 100%; min-width: 0; table-layout: fixed; }
.prt-consultation-result .prt-vehicle-table td,
.prt-consultation-result .prt-history-table th,
.prt-consultation-result .prt-history-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  vertical-align: top;
}
.prt-consultation-result .prt-vehicle-table td { font-size: 15px; line-height: 1.5; padding: 10px 12px; }
.prt-consultation-result .prt-vehicle-table td:first-child { width: 36%; }
.prt-consultation-result .prt-vehicle-note { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.prt-consultation-result .prt-history-table th,
.prt-consultation-result .prt-history-table td { font-size: 13px; line-height: 1.45; padding: 10px 8px; }
.prt-consultation-result .prt-history-table th:nth-child(1) { width: 14%; }
.prt-consultation-result .prt-history-table th:nth-child(2) { width: 11%; }
.prt-consultation-result .prt-history-table th:nth-child(3) { width: 23%; }
.prt-consultation-result .prt-history-table th:nth-child(4) { width: 24%; }
.prt-consultation-result .prt-history-table th:nth-child(5) { width: 15%; }
.prt-consultation-result .prt-history-table th:nth-child(6) { width: 13%; }
.prt-consultation-result .prt-history-table td:last-child span { max-width: 100%; font-size: 13px; line-height: 1.4; }
@media (min-width: 1024px) {
  .prt-result-sidebar > .grid { grid-template-columns: minmax(0, 1fr); }
  #root .prt-result-layout { flex-direction: row; }
  .prt-result-layout > .prt-result-column { width: calc(75% - 12px); order: 2; }
  .prt-result-layout > .prt-result-sidebar { width: calc(25% - 12px); order: 1; }
}
@media (max-width: 767px) {
  .prt-consultation-result .prt-history-table,
  .prt-consultation-result .prt-history-table tbody { display: block; width: 100%; }
  /* Conservar encabezados semánticos para lectores de pantalla. */
  .prt-consultation-result .prt-history-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .prt-consultation-result .prt-history-table tbody { background: transparent; }
  .prt-consultation-result .prt-history-table tbody tr {
    display: block; width: 100%; margin: 0 0 12px;
    border: 1px solid #c5cbd3; border-top: 4px solid #7c9cc4;
    border-radius: 3px; background: #f2f3f5;
  }
  .prt-consultation-result .prt-history-table tbody tr:last-child { margin-bottom: 0; }
  .prt-consultation-result .prt-history-table td {
    display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 10px; width: 100%; min-width: 0; padding: 10px 12px;
    font-size: 15px; line-height: 1.45; border-bottom: 1px solid #dce0e5;
  }
  .prt-consultation-result .prt-history-table td::before {
    content: attr(data-label); font-weight: 700; color: #374151;
  }
  .prt-consultation-result .prt-history-table td:last-child { border-bottom: 0; }
  .prt-consultation-result .prt-history-table td:last-child span { justify-self: start; font-size: 14px; }
  .prt-consultation-result .prt-history-container { border: 0; box-shadow: none; background: transparent; }
}
@media (max-width: 339px) {
  .prt-consultation-result .prt-vehicle-table,
  .prt-consultation-result .prt-vehicle-table tbody,
  .prt-consultation-result .prt-vehicle-table tr,
  .prt-consultation-result .prt-vehicle-table td { display: block; width: 100%; }
  .prt-consultation-result .prt-vehicle-table td:first-child { width: 100%; padding-bottom: 2px; border-right: 0; }
  .prt-consultation-result .prt-vehicle-table td:last-child { padding-top: 2px; border-bottom: 1px solid #e5e7eb; }
  .prt-consultation-result .prt-history-table td { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}

/* Composición de la referencia aportada por el usuario. Sin cambios de negocio. */
body.prt-reference-body { background: #f0f0ef; }
#root.prt-reference-public { font-family: Arial, Helvetica, sans-serif; }
#root.prt-reference-public .prt-reference-shell { max-width: 1200px; box-shadow: 0 0 5px #0002; }
#root.prt-reference-public nav { background: linear-gradient(#3d6ec5, #003699); font-size: 14px; }
#root.prt-reference-public nav li { border: 0; background: transparent; }
#root.prt-reference-public nav a { padding: 13px 15px; }
#root .prt-reference-layout { display: flex; flex-direction: column; gap: 20px; }
#root .prt-reference-column { width: 100%; order: 0; }
#root .prt-reference-promo, #root .prt-reference-banner { display: none; }
#root .prt-reference-search { background: white; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
#root .prt-reference-search > div:last-child { padding: 20px 4px 8px; }
.prt-reference-intro p:first-child { font-size: 16px; font-weight: 700; color: #003c9b; }
.prt-reference-intro p:first-child span { color: #e30613; }
.prt-reference-intro h1 { font-size: 23px; line-height: 1.2; font-weight: 700; color: #333; }
.prt-reference-intro p:last-child { font-size: 16px; line-height: 1.5; color: #717171; }
#root .prt-reference-summary { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; background: none; border: 0; padding: 0; }
#root .prt-reference-summary > span { font-size: 0; }
#root .prt-reference-summary strong { display: block; min-width: 178px; padding: 6px 10px 14px; border: 2px solid #555; border-radius: 5px; box-shadow: 0 1px 2px #777; font: bold 28px/1.2 Arial, sans-serif; letter-spacing: 3px; color: #555; text-align: center; }
#root .prt-reference-summary strong::after { content: '· C H I L E ·'; display: block; font-size: 8px; letter-spacing: 2px; margin-top: 5px; color: #777; }
#root .prt-reference-summary .prt-back-to-search { background: none; color: #003a91; box-shadow: none; padding: 0; gap: 8px; }
#root .prt-reference-summary .prt-back-to-search svg { width: 26px; height: 26px; color: #168ab4; }
#root .prt-reference-links, #root .prt-reference-seal { background: #fafafa; border: 1px solid #ddd; padding: 8px; border-radius: 4px; }
#root .prt-reference-links > div:first-child, #root .prt-reference-seal > div:first-child { border: 1px solid #d5d5d5; box-shadow: 0 1px 2px #ccc; padding: 6px; background: white; }
#root .prt-reference-links h4, #root .prt-reference-seal h4 { color: #003a98; font-size: 15px; margin: auto; }
#root .prt-reference-links > div:last-child, #root .prt-reference-seal > div:last-child { margin-top: 10px; border: 1px solid #ddd; box-shadow: 0 1px 2px #ddd; }
#root .prt-reference-links a { font-size: 14px; font-weight: 400; line-height: 1.5; padding: 10px 0; }
#root .prt-reference-seal img { width: 150px; height: 150px; }
#root .prt-reference-result { margin-top: 0; }
#root .prt-consultation-result { margin-top: 0; }
#root .prt-consultation-result > * + * { margin-top: 4px; }
#root .prt-consultation-result .prt-vehicle-heading, #root .prt-consultation-result .prt-history-heading { background: #718fc0; border: 1px solid #aaa; box-shadow: none; }
@media (min-width: 1024px) {
  #root .prt-reference-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px 32px; }
  #root .prt-reference-column { display: contents; }
  #root .prt-reference-column > * { margin-top: 0; min-width: 0; }
  #root .prt-reference-search { grid-column: 1; grid-row: 1; }
  #root .prt-reference-result { grid-column: 1; grid-row: 2 / span 2; }
  #root .prt-reference-links { grid-column: 2; grid-row: 1; min-height: 240px; }
  #root .prt-reference-links > div:last-child { min-height: 175px; }
  #root .prt-reference-seal { grid-column: 2; grid-row: 2; align-self: start; }
  #root .prt-reference-seal > div:last-child { min-height: 210px; }
  #root .prt-consultation-result .prt-vehicle-heading, #root .prt-consultation-result .prt-history-heading { min-height: 32px; padding: 4px 6px; font-size: 14px; }
  #root .prt-consultation-result .prt-history-table th, #root .prt-consultation-result .prt-history-table td { padding: 6px 5px; font-size: 13px; font-weight: 400; }
  #root .prt-consultation-result .prt-history-table th { font-weight: 700; }
}
@media (max-width: 767px) {
  .prt-reference-intro h1 { font-size: 21px; }
  #root .prt-reference-layout { gap: 16px; }
  #root .prt-reference-links a { min-height: 44px; }
  #root .prt-consultation-result .prt-history-table td { padding: 10px 12px; font-size: 15px; }
}

#root .prt-reference-search form > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#root .prt-reference-search form > div:first-of-type { margin-top: 10px; }
#root .prt-reference-summary strong { background: white url('/assets/patente-prt.png') center / 100% 100% no-repeat; min-height: 60px; padding: 6px 10px 16px; overflow-wrap: anywhere; }
#root .prt-reference-summary strong::after { content: none; }

/* Formulario autónomo: conserva el tamaño aun si no carga el CSS externo. */
#root.prt-reference-public .prt-reference-search { background: #f4f4f4 url('/assets/fondo-consulta-prt.png') right bottom / auto 90% no-repeat; border-radius: 8px; padding: 10px; }
#root.prt-reference-public .prt-reference-search .prt-reference-intro { display: none; }
#root.prt-reference-public .prt-reference-search .prt-reference-banner { display: block; background: white; box-shadow: 0 2px 5px #0002; }
#root.prt-reference-public .prt-reference-banner img { display: block; width: 100%; height: auto; }
#root.prt-reference-public .prt-reference-search > div:last-child { padding: 24px 12px 10px; }
#root.prt-reference-public .prt-reference-search form > label { position: static; display: block; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; font-size: 17px; font-weight: 400; line-height: 1.4; color: #555; }
#root.prt-reference-public .prt-reference-search form > div:first-of-type { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; margin: 6px 0 12px; }
#root.prt-reference-public .prt-plate-input { position: relative; flex: 0 1 210px; width: 210px; min-width: 0; max-width: 210px; height: 74px; display: flex; align-items: center; justify-content: center; }
#root.prt-reference-public .prt-plate-input img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
#root.prt-reference-public .prt-plate-input input { position: relative; z-index: 1; display: block; width: 100%; min-width: 0; height: 100%; border: 0; padding: 2px 8px 20px; background: transparent; text-align: center; font-size: 29px; font-weight: 900; text-transform: uppercase; letter-spacing: 3px; color: #555; outline-offset: -6px; }
#root.prt-reference-public .prt-search-submit { display: flex; align-items: center; justify-content: center; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; border: 1px solid #34547c; border-radius: 6px; color: white; background: linear-gradient(#96b4da,#365782); box-shadow: 0 1px 3px #0002; }
#root.prt-reference-public .prt-search-submit svg { display: block; width: 27px; height: 27px; }
#root.prt-reference-public .prt-captcha-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; max-width: 304px; min-height: 80px; padding: 12px 10px; border: 1px solid #d3d3d3; border-radius: 3px; background: #fafafa; box-shadow: 0 1px 2px #0001; box-sizing: border-box; }
#root.prt-reference-public .prt-captcha-box > label { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
#root.prt-reference-public .prt-captcha-box input { width: 26px; height: 26px; margin: 0; flex-shrink: 0; }
#root.prt-reference-public .prt-captcha-box > div { display: flex; flex-direction: column; align-items: center; font-size: 10px; line-height: 1.3; }
#root.prt-reference-public .prt-captcha-box img { width: 32px; height: 32px; }
#root.prt-reference-public .prt-captcha-box > div > div { display: flex; gap: 3px; font-size: 8px; }
@media (max-width: 767px) {
  #root.prt-reference-public .prt-reference-search { padding: 8px; }
  #root.prt-reference-public .prt-reference-search > div:last-child { padding: 22px 8px 10px; }
  #root.prt-reference-public .prt-reference-search form > label { font-size: 16px; }
  #root.prt-reference-public .prt-plate-input { flex-basis: 180px; height: 65px; max-width: 180px; }
  #root.prt-reference-public .prt-plate-input input { font-size: 25px; letter-spacing: 2px; padding-bottom: 18px; }
  #root.prt-reference-public .prt-reference-links a { display: block; }
}
@media (max-width: 359px) {
  #root.prt-reference-public .prt-captcha-box { padding: 10px 7px; gap: 5px; }
  #root.prt-reference-public .prt-captcha-box > label { font-size: 13px; gap: 6px; }
  #root.prt-reference-public .prt-captcha-box input { width: 24px; height: 24px; }
}

body.prt-reference-body { margin: 0; }

/* Escritorio de referencia. La presentación móvil aprobada permanece intacta. */
@media (min-width: 1024px) {
  #root.prt-reference-public .prt-reference-search { background: white; border: 0; border-radius: 0; padding: 0; }
  #root.prt-reference-public .prt-reference-search .prt-reference-intro { display: block; }
  #root.prt-reference-public .prt-reference-search .prt-reference-banner { display: none; }
  #root.prt-reference-public .prt-reference-search > div:last-child { padding: 22px 4px 8px; }
  #root.prt-reference-public .prt-reference-search form > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #root.prt-reference-public .prt-plate-input { flex-basis: 178px; width: 178px; max-width: 178px; height: 60px; }
  #root.prt-reference-public .prt-plate-input input { font-size: 28px; letter-spacing: 3px; padding-bottom: 16px; }
  #root.prt-reference-public .prt-reference-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px 32px; }
  #root.prt-reference-public .prt-reference-column { display: contents; }
  #root.prt-reference-public .prt-reference-links { min-height: 280px; }
  #root.prt-reference-public .prt-reference-links > div:last-child { min-height: 215px; }
  #root.prt-reference-public .prt-consultation-result .prt-vehicle-table tr { background: #ebebeb; }
  #root.prt-reference-public .prt-consultation-result .prt-vehicle-table td { font-size: 14px; line-height: 1.45; padding: 10px 16px; border-bottom: 1px dotted #aaa; }
  #root.prt-reference-public .prt-consultation-result .prt-vehicle-table td:first-child { width: 18%; border-right: 0; color: #333; font-weight: 700; }
  #root.prt-reference-public .prt-consultation-result .prt-vehicle-table td:last-child { color: #555; font-weight: 400; }
  #root.prt-reference-public .prt-consultation-result .prt-history-table th, #root.prt-reference-public .prt-consultation-result .prt-history-table td { padding: 5px; font-size: 13px; border-bottom: 1px solid #aaa; }
  #root.prt-reference-public .prt-consultation-result .prt-history-table th:nth-child(1) { width: 12%; }
  #root.prt-reference-public .prt-consultation-result .prt-history-table th:nth-child(2) { width: 10%; }
  #root.prt-reference-public .prt-consultation-result .prt-history-table th:nth-child(3) { width: 30%; }
  #root.prt-reference-public .prt-consultation-result .prt-history-table th:nth-child(4) { width: 25%; }
  #root.prt-reference-public .prt-consultation-result .prt-history-table th:nth-child(5) { width: 13%; }
  #root.prt-reference-public .prt-consultation-result .prt-history-table th:nth-child(6) { width: 10%; }
}
