/* Opt-in file cards + sticky action. Only .pvc-app pages link this file. */

.pvc-app.cpdf-app {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.pvc-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 14px 16px;
  align-items: stretch;
}

.pvc-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pvc-board {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e3e9f1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(30, 50, 90, 0.05);
}

.pvc-board > .conv-card,
.pvc-board > .conv-stack > .conv-card,
.pvc-board .conv-files {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pvc-drop-card[hidden],
.pvc-files[hidden] { display: none !important; }

.pvc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 16px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: none;
  overflow: visible;
}

.article .pvc-cards > li,
.article .pvc-hist .itool-hist-list > li {
  margin: 0;
  list-style: none;
}

.article .pvc-cards > li::before,
.article .pvc-cards > li::marker,
.article .pvc-hist .itool-hist-list > li::before,
.article .pvc-hist .itool-hist-list > li::marker { content: none; }

.pvc-file-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pvc-file-card.is-loading .pvc-sheet-fallback { animation: pvc-pulse 1s ease-in-out infinite; }
.pvc-file-card.is-dragging { opacity: 0.55; }
.pvc-file-card.is-drag-over .pvc-sheet { outline: 2px solid #2563eb; }
.pvc-file-card.is-error .pvc-sheet { border-color: #fca5a5; }
.pvc-file-card.is-error .pvc-card-meta { color: #dc2626; }
.pvc-file-card.is-error .pvc-card-x { opacity: 1; }

@keyframes pvc-pulse { 50% { opacity: 0.45; } }

.pvc-sheet {
  position: relative;
  aspect-ratio: 1 / 1.32;
  overflow: hidden;
  border: 1px solid #e3e9f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(30, 50, 90, 0.08);
}

.pvc-sheet-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  background: #fff;
  pointer-events: none;
}

.pvc-sheet-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #fff, #f8fafc);
  color: #dc2626;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pvc-app .pvc-card-n,
.pvc-app .pvc-card-x,
.pvc-app .pvc-card-dl { position: absolute; z-index: 1; }

.pvc-app .pvc-card-n {
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.pvc-app .pvc-card-x,
.pvc-app .pvc-card-dl {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #e3e9f1;
  border-radius: 50%;
  background: #fff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.pvc-app .pvc-card-x {
  top: 6px;
  right: 6px;
  color: #dc2626;
  opacity: 0;
}

.pvc-app .pvc-card-dl {
  right: 6px;
  bottom: 6px;
  color: #1d4ed8;
  font-weight: 800;
}

.pvc-file-card:hover .pvc-card-x,
.pvc-file-card:focus-within .pvc-card-x { opacity: 1; }

@media (hover: none) {
  .pvc-app .pvc-card-x { opacity: 1; }
}

.pvc-card-name {
  overflow: hidden;
  color: #172033;
  font-size: 0.78rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pvc-card-meta {
  margin-top: -2px;
  color: #64748b;
  font-size: 0.7rem;
  line-height: 1.3;
}

.pvc-app .pvc-add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  aspect-ratio: 1 / 1.32;
  border: 1.5px dashed #7aa7f5;
  border-radius: 12px;
  background: #f5f9ff;
  color: #1d4ed8;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.pvc-app .pvc-add-card:disabled { opacity: 0.55; cursor: not-allowed; }

.pvc-add-plus {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e3edfd;
  font-size: 1.45rem;
  line-height: 1;
}

.pvc-order {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
}

.pvc-app .cpdf-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  background: transparent;
  position: static;
  z-index: auto;
}

.pvc-app .cpdf-side .cpdf-card,
.pvc-app .cpdf-side .conv-card,
.pvc-app .cpdf-side .conv-tips {
  margin: 0;
  padding: 16px;
  border: 1px solid #e3e9f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(30, 50, 90, 0.04);
}

.pvc-app .cpdf-side .conv-tips { background: #fff8e8; border-color: #f7e3b5; }
.pvc-app .cpdf-side .conv-card-title,
.pvc-app .cpdf-side .conv-tips h2 { margin: 0 0 10px; font-size: 0.98rem; }

.pvc-app .pvc-go {
  width: 100%;
  min-height: 54px;
  margin-top: 0;
  border-radius: 12px;
  border-color: #1d4ed8 !important;
  background: linear-gradient(180deg, #2f6ff0, #1d5ad6) !important;
  color: #fff !important;
  font-size: 1rem;
  font-weight: 800;
}

.pvc-app .pvc-go:disabled {
  border-color: #e3e9f1 !important;
  background: #fff !important;
  color: #64748b !important;
  opacity: 0.6;
}

@media (min-width: 981px) {
  .pvc-app .pvc-action {
    position: sticky;
    top: 123px;
    z-index: 41;
  }

  .pvc-app .pvc-action.is-stuck {
    border-radius: 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  }
}

/* Recentes neste aparelho — shared bottom strip for every PDF tool (markup: pdf-tools-ui.js) */
.pvc-hist:not(:has(.itool-hist-host:not([hidden]))) { display: none; }
.pvc-hist { margin-top: 10px; }

.pvc-hist .itool-hist-host { margin: 0; width: 100%; max-width: none; padding: 0; }
.pvc-hist .itool-hist-host[hidden] { display: none !important; }

.pvc-hist .itool-hist-card {
  margin: 0;
  padding: 16px 18px 18px;
  border: 1px solid #e6ecf4;
  border-radius: 20px;
  background: #f7f9fc;
  box-shadow: 0 10px 28px rgba(30, 50, 90, 0.05);
}

.pvc-hist .itool-hist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.pvc-hist .itool-hist-title-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pvc-hist .itool-hist-label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #0f1d4a;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: none;
}

.pvc-hist .pdf-hist-clock {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  max-width: none;
  color: #1d4ed8;
}

.pvc-hist .itool-hist-hint {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e9eef6;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.pvc-hist .itool-hist-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid #e3e9f1;
  border-radius: 12px;
  background: #fff;
  color: #0f1d4a;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pvc-hist .itool-hist-clear-icon { color: #dc2626; }
.pvc-hist .itool-hist-clear:hover { border-color: #fecaca; background: #fff; }

.pvc-hist .pdf-hist-scroll { position: relative; }

.article .pvc-hist .itool-hist-list,
.pvc-hist .itool-hist-list {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 2px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.pvc-hist .itool-hist-list::-webkit-scrollbar { display: none; }

.article .pvc-hist .itool-hist-list > li.itool-hist-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 20px;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 10px;
  flex: 0 0 300px;
  align-items: start;
  min-width: 0;
  padding: 12px 12px 12px 10px;
  overflow: visible;
  border: 1px solid #e6ecf4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  scroll-snap-align: start;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.article .pvc-hist .itool-hist-list > li.itool-hist-item:hover,
.article .pvc-hist .itool-hist-list > li.itool-hist-item:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.pvc-hist .pdf-hist-thumb {
  position: relative;
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 96px;
  height: 116px;
  overflow: hidden;
  border: 1px solid #e6ecf4;
  border-radius: 8px;
  background: #fff;
}

.pvc-hist .pdf-hist-thumb::after {
  content: "PDF";
  position: absolute;
  left: 10px;
  bottom: 22px;
  z-index: 2;
  padding: 4px 6px;
  border-radius: 5px;
  background: #e11d27;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(225, 29, 39, 0.25);
}

.pvc-hist .pdf-hist-thumb img,
.pvc-hist .pdf-hist-preview {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: top center;
  background: #fff;
}

.pvc-hist .pdf-hist-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pvc-hist .pdf-hist-ico { opacity: 0.35; }
.pvc-hist .pdf-hist-thumb.has-preview .pdf-hist-art { display: none; }
.pvc-hist .pdf-hist-chip { display: none; }

.pvc-hist .itool-hist-meta {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  padding-top: 14px;
}

.pvc-hist .itool-hist-name {
  display: block;
  overflow: hidden;
  color: #0f1d4a;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pvc-hist .itool-hist-sub {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pvc-hist .pdf-hist-more {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  margin-top: 14px;
}

.pvc-hist .pdf-hist-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}

.pvc-hist .pdf-hist-more-btn:hover,
.pvc-hist .pdf-hist-more.is-open .pdf-hist-more-btn { background: #eef2f8; color: #0f1d4a; }

.pvc-hist .pdf-hist-menu {
  position: absolute;
  top: 46px;
  right: 10px;
  z-index: 5;
  min-width: 170px;
  padding: 4px;
  border: 1px solid #e3e9f1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.pvc-hist .pdf-hist-menu[hidden] { display: none; }

.pvc-hist .pdf-hist-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.pvc-hist .pdf-hist-menu button:hover,
.pvc-hist .pdf-hist-menu button:focus-visible { background: #fef2f2; outline: none; }

.pvc-hist .itool-hist-actions {
  display: flex;
  grid-column: 2 / -1;
  grid-row: 2;
  align-self: end;
  gap: 10px;
}

.pvc-hist .itool-hist-btn {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #e3e9f1;
  border-radius: 12px;
  background: #fff;
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pvc-hist .itool-hist-btn:hover,
.pvc-hist .itool-hist-btn:focus-visible { border-color: #bfdbfe; background: #eff6ff; }
.pvc-hist .pdf-hist-dl { flex: 0 0 auto; color: #2563eb; }
.pvc-hist .itool-hist-latest { display: none; }

.pvc-hist .pdf-hist-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #e6ecf4;
  border-radius: 50%;
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transform: translateY(-50%);
}

.pvc-hist .pdf-hist-nav[hidden] { display: none; }
.pvc-hist .pdf-hist-nav.is-next { right: -6px; }
.pvc-hist .pdf-hist-nav.is-prev { left: -6px; }
.pvc-hist .pdf-hist-nav.is-prev svg { transform: rotate(180deg); }
.pvc-hist .pdf-hist-nav:hover { background: #eff6ff; }

@media (max-width: 980px) {
  .pvc-shell { grid-template-columns: minmax(0, 1fr); }
  .pvc-app.cpdf-app { gap: 12px; }
  body.pvc-action-pinned .pvc-action {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    z-index: 40;
    margin: 0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
  }
  body.pvc-action-pinned .conv-page,
  body.pvc-action-pinned .anpdf-page,
  body.pvc-action-pinned .pvc-page { padding-bottom: 148px; }
  body.pvc-action-pinned .pvc-main { padding-bottom: 168px; }
}

@media (max-width: 640px) {
  .pvc-main { gap: 12px; }
  .pvc-board { padding: 10px 10px 12px; }
  .pvc-cards {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 12px 8px;
  }
  .article .pvc-hist .itool-hist-list > li.itool-hist-item {
    grid-template-columns: 76px minmax(0, 1fr) 20px;
    column-gap: 10px;
    flex-basis: 88%;
  }
  .pvc-hist .pdf-hist-thumb { width: 76px; height: 100px; }
  .pvc-hist .pdf-hist-thumb::after { left: 7px; bottom: 16px; }
  .pvc-hist .itool-hist-meta,
  .pvc-hist .pdf-hist-more { padding-top: 6px; margin-top: 0; }
  .pvc-hist .itool-hist-card { padding: 14px 12px 14px; }
  .pvc-hist .pdf-hist-nav { display: none; }
}

html[data-theme="dark"] .pvc-board,
html[data-theme="dark"] .pvc-hist .itool-hist-card,
html[data-theme="dark"] .pvc-app .cpdf-side .cpdf-card,
html[data-theme="dark"] .pvc-app .cpdf-side .conv-card {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .pvc-app .cpdf-side .conv-tips { background: #2a2416; border-color: #4a3d1c; }
html[data-theme="dark"] .pvc-sheet,
html[data-theme="dark"] .pvc-sheet-img,
html[data-theme="dark"] .pvc-app .pvc-card-x,
html[data-theme="dark"] .pvc-app .pvc-card-dl,
html[data-theme="dark"] .pvc-sheet-fallback { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .pvc-card-name,
html[data-theme="dark"] .pvc-hist .itool-hist-label,
html[data-theme="dark"] .pvc-hist .itool-hist-name { color: #f8fafc; }
html[data-theme="dark"] .pvc-app .pvc-add-card { background: #0f1b33; border-color: #3b5b99; color: #93c5fd; }
html[data-theme="dark"] .pvc-add-plus { background: #1b2d52; }
html[data-theme="dark"] .article .pvc-hist .itool-hist-list > li.itool-hist-item,
html[data-theme="dark"] .pvc-hist .itool-hist-clear,
html[data-theme="dark"] .pvc-hist .itool-hist-btn,
html[data-theme="dark"] .pvc-hist .pdf-hist-thumb { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .pvc-hist .itool-hist-hint { background: #334155; color: #cbd5e1; }
html[data-theme="dark"] .pvc-hist .itool-hist-sub,
html[data-theme="dark"] .pvc-hist .itool-hist-clear { color: #cbd5e1; }
html[data-theme="dark"] .pvc-hist .pdf-hist-clock { color: #60a5fa; }
html[data-theme="dark"] .pvc-hist .itool-hist-clear-icon { color: #f87171; }
html[data-theme="dark"] .article .pvc-hist .itool-hist-list > li.itool-hist-item:hover,
html[data-theme="dark"] .article .pvc-hist .itool-hist-list > li.itool-hist-item:focus-within {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px #60a5fa;
}
html[data-theme="dark"] .pvc-hist .itool-hist-btn { color: #bfdbfe; }
html[data-theme="dark"] .pvc-hist .itool-hist-btn:hover,
html[data-theme="dark"] .pvc-hist .itool-hist-btn:focus-visible { background: #172554; border-color: #1e40af; }
html[data-theme="dark"] .pvc-hist .pdf-hist-dl { color: #60a5fa; }
html[data-theme="dark"] .pvc-hist .pdf-hist-more-btn { color: #94a3b8; }
html[data-theme="dark"] .pvc-hist .pdf-hist-more-btn:hover,
html[data-theme="dark"] .pvc-hist .pdf-hist-more.is-open .pdf-hist-more-btn { background: #1e293b; color: #f8fafc; }
html[data-theme="dark"] .pvc-hist .pdf-hist-menu,
html[data-theme="dark"] .pvc-hist .pdf-hist-nav { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .pvc-hist .pdf-hist-menu button { color: #fca5a5; }
html[data-theme="dark"] .pvc-hist .pdf-hist-menu button:hover,
html[data-theme="dark"] .pvc-hist .pdf-hist-menu button:focus-visible { background: #3b1219; }
html[data-theme="dark"] .pvc-hist .pdf-hist-nav { color: #93c5fd; }
html[data-theme="dark"] .pvc-hist .pdf-hist-nav:hover { background: #172554; }
