/* A ficha do acervo e a busca usam a mesma vista documental. */
#edital-documentos {
  --mm-text: var(--texto);
  --mm-muted: var(--muted);
  --mm-surface: var(--superficie);
  --mm-bg: var(--fundo);
  --mm-border: var(--borda);
  --mm-accent: var(--link);
  --mm-radius: 4px;
  --bs-body-bg: var(--superficie);
  --bs-body-color: var(--texto);
  --bs-border-color: var(--borda);
  --bs-link-color: var(--link);
  --bs-emphasis-color: var(--texto);
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--borda);
  border-top: 4px solid var(--link);
  background: var(--superficie);
  min-width: 0;
}
.edv-workspace {
  display: grid;
  grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 0.75rem;
}
.edv-documents {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  max-height: calc(100dvh - 16rem);
  min-height: 12rem;
  overflow-y: auto;
}
.edv-documents button {
  text-align: left;
  justify-content: flex-start;
  overflow-wrap: anywhere;
  white-space: normal;
  flex-shrink: 0;
}
.edv-documents [aria-pressed="true"] {
  border-inline-start: 4px solid var(--mm-accent);
  font-weight: 600;
}
.edv-content,
.edv-document {
  min-width: 0;
}
.edv-document,
.edv-documents,
.edv-generation {
  --dr-ink: var(--mm-text);
  --dr-muted: var(--mm-muted);
  --dr-bg: var(--mm-surface);
  --dr-canvas: var(--mm-bg);
  --dr-border: var(--mm-border);
  --dr-accent: var(--mm-accent);
  --dr-radius: 4px;
}
.edv-document [hidden] {
  display: none !important;
}
.edv-tabs,
.edv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}
.edv-tabs {
  border-bottom: 1px solid var(--mm-border);
  padding-bottom: 0.5rem;
}
.edv-tabs [aria-selected="true"] {
  border-bottom: 3px solid var(--mm-accent);
  font-weight: 700;
}
.edv-reading {
  height: calc(100dvh - 17rem);
  min-height: 36rem;
}
.edv-notice {
  color: var(--mm-muted);
  margin-block: 0.5rem;
  overflow-wrap: anywhere;
}
.edv-files {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
}
.edv-pdf-frame {
  width: 100%;
  height: 75dvh;
  min-height: 30rem;
  border: 1px solid var(--mm-border);
}
.edv-parts {
  display: grid;
  gap: 0.25rem;
  max-width: 100%;
}
.edv-parts select {
  max-width: 100%;
}
.edv-document .dr-button {
  min-height: 44px;
}
.edm-reader-host:has(.edv-document) {
  height: auto;
}
.edv-generation {
  padding: 1rem;
  border: 1px solid var(--mm-border);
  background: var(--mm-surface);
  color: var(--mm-text);
}
.edv-generation p {
  max-width: 65ch;
}
.edv-generation .dr-button {
  min-height: 44px;
  margin-top: 1rem;
}
.edv-generation label {
  display: grid;
  gap: 0.25rem;
  margin-top: 1rem;
}
.edv-generation input {
  width: min(100%, 28rem);
  min-height: 44px;
}
.edv-generation > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 1rem 0.5rem 0;
}
.edv-deposit-address {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
  color: var(--mm-text);
}
.edv-deposit-qr {
  width: fit-content;
  padding: 0.75rem;
  margin-block: 1rem;
  background: #fff;
}
@media (max-width: 760px) {
  .edv-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .edv-documents {
    max-height: 18rem;
  }
  .edv-reading {
    height: 90dvh;
    min-height: 40rem;
  }
  .edv-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .edv-tabs .dr-button {
    padding-inline: 0.5rem;
  }
  #edital-documentos {
    padding: 0.5rem;
  }
}
