/* Modal animado — Extração sob demanda (Templates/extrator_modal_v3.html) */
#extrator-modal {
  border: 1px solid #dce5f0;
  border-radius: 20px;
  padding: 0;
  width: min(940px, 94vw);
  max-height: 94dvh;
  color: #142743;
  box-shadow: 0 24px 100px #10284835;
  background: #fff;
  font: 15px "DM Sans", Inter, system-ui, sans-serif;
}
#extrator-modal::backdrop {
  background: #152b4666;
  backdrop-filter: blur(5px);
}
#extrator-modal[open] {
  display: flex;
  flex-direction: column;
  height: min(650px, 94dvh);
  max-height: 94dvh;
  overflow: hidden;
}
#extrator-modal button,
#extrator-modal a {
  font: inherit;
}
#extrator-modal button {
  cursor: pointer;
}
#extrator-modal .xm-eyebrow,
#extrator-modal small {
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 750;
  color: #57718e;
}
#extrator-modal .xm-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 26px;
  border-bottom: 1px solid #e5ebf2;
  flex-shrink: 0;
}
#extrator-modal .xm-top strong {
  display: block;
  font-size: 19px;
  color: #142743;
}
#extrator-modal .xm-iconbtn {
  border: 1px solid #dce5ef;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  color: #526780;
}
#extrator-modal .xm-primary {
  background: #245bdd;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 13px 20px;
  text-decoration: none;
  font-weight: 650;
  display: inline-block;
}
#extrator-modal .xm-progress {
  height: 3px;
  background: #e8eef6;
  flex-shrink: 0;
  flex-basis: 3px;
}
#extrator-modal .xm-progress i {
  display: block;
  height: 100%;
  background: #245bdd;
  transition: width .3s;
  width: 0;
}
#extrator-modal .xm-layout {
  display: grid;
  grid-template-columns: 255px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#extrator-modal .xm-steps {
  padding: 22px 16px;
  background: #f7f9fc;
  border-right: 1px solid #e5ebf2;
  min-height: 0;
  overflow: auto;
}
#extrator-modal .xm-step {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 14px 10px;
  border-radius: 9px;
  color: #677c94;
  font-size: 13px;
}
#extrator-modal .xm-step b {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid #d5e1ed;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}
#extrator-modal .xm-step.is-active {
  background: #e8efff;
  color: #245bdd;
  font-weight: 700;
}
#extrator-modal .xm-step.is-active b {
  background: #245bdd;
  color: #fff;
  border-color: #245bdd;
}
#extrator-modal .xm-step.is-done b {
  color: #16836b;
}
#extrator-modal .xm-content {
  display: grid;
  grid-template-rows: 14px 38px 48px minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 24px 28px;
}
#extrator-modal .xm-content h2 {
  font-size: 25px;
  letter-spacing: -.8px;
  margin: 0;
  align-self: center;
  font-family: "Manrope", "DM Sans", sans-serif;
  color: #142743;
}
#extrator-modal .xm-desc {
  color: #62758b;
  margin: 0;
  line-height: 1.5;
  overflow: auto;
}
#extrator-modal .xm-demo {
  border: 1px solid #dce5ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fbfcfe;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#extrator-modal .xm-bar {
  padding: 12px 16px;
  border-bottom: 1px solid #e2eaf3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
#extrator-modal .xm-bar span {
  color: #8092a7;
  font-size: 11px;
}
#extrator-modal .xm-inner {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 14px 18px;
}
#extrator-modal .xm-inner > .xm-chips {
  min-height: 29px;
}
#extrator-modal .xm-inner p {
  margin: 12px 0;
}
#extrator-modal .xm-field {
  border: 1px solid #dce5ef;
  background: #fff;
  border-radius: 7px;
  padding: 12px;
  margin: 7px 0 15px;
  overflow-wrap: anywhere;
  font: 13px ui-monospace, monospace;
}
#extrator-modal .xm-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
#extrator-modal .xm-chip {
  background: #eaf0fb;
  color: #315b99;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
}
#extrator-modal .xm-ok {
  color: #16836b;
}
#extrator-modal .xm-center {
  text-align: center;
  padding: 15px;
}
#extrator-modal .xm-bigicon {
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: #e7efff;
  color: #245bdd;
  font-size: 30px;
}
#extrator-modal .xm-meter {
  height: 6px;
  border-radius: 8px;
  background: #e4ebf4;
  overflow: hidden;
  margin: 16px 0;
}
#extrator-modal .xm-meter i {
  display: block;
  height: 100%;
  background: #3268e7;
  transition: width .35s;
}
#extrator-modal .xm-foot {
  padding: 16px 26px;
  border-top: 1px solid #e5ebf2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
#extrator-modal .xm-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#extrator-modal .xm-note {
  padding: 10px 26px;
  background: #f7f9fc;
  color: #61748c;
  font-size: 11px;
  flex-shrink: 0;
}
#extrator-modal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#extrator-modal td,
#extrator-modal th {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #e5ebf2;
}
#extrator-modal th {
  color: #71859c;
  font-size: 10px;
  text-transform: uppercase;
}
#extrator-modal .xm-appear {
  animation: xm-appear .35s both;
}
@keyframes xm-appear {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
body:has(#extrator-modal[open]) {
  overflow: hidden;
}
@media (max-width: 650px) {
  #extrator-modal[open] {
    height: min(700px, 94dvh);
    width: 94vw;
  }
  #extrator-modal .xm-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 50px minmax(0, 1fr);
  }
  #extrator-modal .xm-steps {
    display: flex;
    padding: 9px;
    gap: 4px;
    border-right: 0;
    align-items: center;
    overflow: hidden;
  }
  #extrator-modal .xm-step {
    justify-content: center;
    padding: 5px;
  }
  #extrator-modal .xm-step span {
    display: none;
  }
  #extrator-modal .xm-content {
    padding: 12px 16px;
    grid-template-rows: 14px 52px 48px minmax(0, 1fr);
    gap: 5px;
  }
  #extrator-modal .xm-content h2 {
    font-size: 22px;
    line-height: 1.15;
  }
  #extrator-modal .xm-top,
  #extrator-modal .xm-foot {
    padding: 12px 16px;
  }
  #extrator-modal .xm-foot {
    flex-wrap: nowrap;
    gap: 5px;
  }
  #extrator-modal .xm-controls {
    flex-wrap: nowrap;
    gap: 5px;
  }
  #extrator-modal .xm-foot .xm-iconbtn,
  #extrator-modal .xm-foot .xm-primary {
    padding: 8px 9px;
    font-size: 12px;
  }
  #extrator-modal .xm-note {
    padding: 10px 16px;
    font-size: 10px;
  }
  #extrator-modal .xm-top strong {
    font-size: 17px;
  }
  #extrator-modal .xm-inner {
    padding: 12px;
  }
  #extrator-modal .xm-inner > .xm-chips {
    min-height: 62px;
  }
}
@media (max-height: 500px) {
  #extrator-modal[open] {
    height: 96dvh;
    max-height: 96dvh;
  }
  #extrator-modal .xm-top,
  #extrator-modal .xm-foot {
    padding: 7px 12px;
  }
  #extrator-modal .xm-note {
    padding: 5px 12px;
  }
  #extrator-modal .xm-content {
    padding: 8px 12px;
    grid-template-rows: 12px 30px 30px minmax(0, 1fr);
    gap: 3px;
  }
  #extrator-modal .xm-content h2 {
    font-size: 18px;
  }
  #extrator-modal .xm-desc {
    font-size: 12px;
  }
  #extrator-modal .xm-bar {
    padding: 6px 10px;
  }
  #extrator-modal .xm-step {
    padding: 5px;
  }
  #extrator-modal .xm-inner {
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #extrator-modal *,
  #extrator-modal *::before,
  #extrator-modal *::after {
    animation: none !important;
    transition: none !important;
  }
}
