:root {
  --jpt-green-950: #113a30;
  --jpt-green-900: #174a3d;
  --jpt-green-700: #21785d;
  --jpt-green-600: #2b8b6b;
  --jpt-green-100: #eaf6f1;
  --jpt-gold: #c6a15b;
  --jpt-ink: #17211e;
  --jpt-muted: #6d7d77;
  --jpt-line: #e3e9e6;
  --jpt-bg: #f5f8f7;
  --jpt-danger: #b44747;
  --jpt-warning-bg: #fff8e8;
  --jpt-warning: #8a651e;
}

body.jpt-no-scroll { overflow: hidden !important; }

.jpt-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  background: rgba(10, 24, 20, .42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}

.jpt-overlay.jpt-open { opacity: 1; visibility: visible; }

.jpt-shell {
  width: min(1180px, 96vw);
  height: 100%;
  background: var(--jpt-bg);
  color: var(--jpt-ink);
  box-shadow: -20px 0 60px rgba(0,0,0,.14);
  transform: translateX(24px);
  transition: transform .2s ease;
  display: flex;
  flex-direction: column;
  font-family: inherit;
}

.jpt-overlay.jpt-open .jpt-shell { transform: translateX(0); }

.jpt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  background: #fff;
  border-bottom: 1px solid var(--jpt-line);
  flex: 0 0 auto;
}

.jpt-title-wrap { min-width: 0; }
.jpt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--jpt-green-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.jpt-title {
  margin: 0;
  color: var(--jpt-green-950);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.1;
  font-weight: 800;
}

.jpt-subtitle {
  margin: 7px 0 0;
  color: var(--jpt-muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 760px;
}

.jpt-icon-button {
  appearance: none;
  border: 1px solid var(--jpt-line);
  background: #fff;
  color: #41534c;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .15s ease, border-color .15s ease;
}
.jpt-icon-button:hover { background: #f4f7f6; border-color: #ccd7d2; }
.jpt-icon-button:focus-visible { outline: 3px solid rgba(43,139,107,.20); outline-offset: 2px; }

.jpt-main {
  overflow: auto;
  padding: 24px 26px 38px;
  flex: 1 1 auto;
}

.jpt-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #d9ebe4;
  background: #f2fbf7;
  border-radius: 14px;
  padding: 12px 14px;
  color: #315f50;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 18px;
}
.jpt-privacy svg { flex: 0 0 auto; margin-top: 1px; }
.jpt-privacy strong { color: #235a46; }

.jpt-tool-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.jpt-tool-tab {
  appearance: none;
  border: 1px solid var(--jpt-line);
  background: #fff;
  border-radius: 15px;
  min-height: 92px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--jpt-ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.jpt-tool-tab:hover { transform: translateY(-1px); box-shadow: 0 7px 22px rgba(23,74,61,.06); }
.jpt-tool-tab.jpt-active { border-color: rgba(43,139,107,.42); box-shadow: 0 0 0 3px rgba(43,139,107,.08); }
.jpt-tab-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--jpt-green-100);
  color: var(--jpt-green-700);
}
.jpt-tool-tab.jpt-active .jpt-tab-icon { background: var(--jpt-green-700); color: #fff; }
.jpt-tab-copy { min-width: 0; display: grid; gap: 4px; }
.jpt-tab-copy strong { font-size: 13px; color: var(--jpt-green-950); line-height: 1.25; }
.jpt-tab-copy small { font-size: 11px; color: var(--jpt-muted); line-height: 1.3; }

.jpt-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--jpt-line);
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(18,65,51,.05);
  overflow: hidden;
}
.jpt-panel.jpt-active { display: block; }

.jpt-panel-head {
  padding: 21px 22px 17px;
  border-bottom: 1px solid var(--jpt-line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.jpt-panel-head h2 { margin: 0; color: var(--jpt-green-950); font-size: 18px; line-height: 1.2; font-weight: 800; }
.jpt-panel-head p { margin: 6px 0 0; color: var(--jpt-muted); font-size: 12px; line-height: 1.45; }

.jpt-panel-body { padding: 22px; }

.jpt-dropzone {
  position: relative;
  min-height: 158px;
  border: 1.5px dashed #bdcec7;
  border-radius: 15px;
  background: #f9fbfa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.jpt-dropzone:hover, .jpt-dropzone.jpt-dragover { background: #f2faf6; border-color: var(--jpt-green-600); }
.jpt-dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.jpt-drop-icon { color: var(--jpt-green-700); }
.jpt-dropzone strong { color: var(--jpt-green-950); font-size: 14px; }
.jpt-dropzone span { color: var(--jpt-muted); font-size: 11px; }

.jpt-file-list { display: grid; gap: 8px; margin-top: 14px; }
.jpt-file-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--jpt-line);
  background: #fff;
  border-radius: 12px;
}
.jpt-file-row[draggable="true"] { cursor: grab; }
.jpt-file-row.jpt-dragging { opacity: .45; }
.jpt-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 9px;
  overflow: hidden;
  background: #eff3f1;
  display: grid;
  place-items: center;
  color: var(--jpt-green-700);
  border: 1px solid #e3e9e6;
}
.jpt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jpt-file-meta { min-width: 0; flex: 1 1 auto; display: grid; gap: 3px; }
.jpt-file-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: #273b34; }
.jpt-file-meta small { font-size: 10px; color: var(--jpt-muted); }
.jpt-file-actions { display: flex; gap: 5px; }
.jpt-mini-btn {
  appearance: none;
  border: 1px solid var(--jpt-line);
  background: #fff;
  color: #52645d;
  border-radius: 8px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}
.jpt-mini-btn:hover { background: #f5f8f7; }
.jpt-mini-btn.jpt-danger { color: var(--jpt-danger); }

.jpt-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 18px;
}
.jpt-field { display: grid; gap: 7px; }
.jpt-field > label { font-size: 11px; font-weight: 700; color: #41554e; }
.jpt-field select, .jpt-field input[type="text"], .jpt-field input[type="number"] {
  width: 100%;
  height: 42px;
  border: 1px solid #d8e1dd;
  border-radius: 10px;
  background: #fff;
  color: #243a32;
  padding: 0 11px;
  font: inherit;
  font-size: 12px;
  outline: 0;
}
.jpt-field select:focus, .jpt-field input:focus { border-color: var(--jpt-green-600); box-shadow: 0 0 0 3px rgba(43,139,107,.10); }
.jpt-field-help { font-size: 10px; color: var(--jpt-muted); line-height: 1.35; }

.jpt-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--jpt-line);
}
.jpt-action-copy { min-width: 0; color: var(--jpt-muted); font-size: 11px; line-height: 1.4; }
.jpt-actions { display: flex; gap: 9px; align-items: center; flex: 0 0 auto; }

.jpt-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.jpt-btn:hover { transform: translateY(-1px); }
.jpt-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.jpt-btn-primary { background: var(--jpt-green-700); color: #fff; }
.jpt-btn-primary:hover { background: #1c6e55; }
.jpt-btn-secondary { background: #eef4f1; color: var(--jpt-green-900); }
.jpt-btn-danger { background: #fff0f0; color: var(--jpt-danger); }

.jpt-status {
  display: none;
  margin-top: 15px;
  border: 1px solid var(--jpt-line);
  border-radius: 12px;
  padding: 12px 13px;
  background: #f8faf9;
}
.jpt-status.jpt-visible { display: block; }
.jpt-status-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 11px; color: #52645d; }
.jpt-progress { height: 6px; border-radius: 999px; overflow: hidden; background: #e3ebe7; margin-top: 8px; }
.jpt-progress > span { display: block; width: 0; height: 100%; background: var(--jpt-green-600); transition: width .18s ease; }
.jpt-status.jpt-error { border-color: #efd2d2; background: #fff7f7; color: #8c4141; }
.jpt-status.jpt-success { border-color: #d0e8de; background: #f3fbf7; }

.jpt-warning {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--jpt-warning-bg);
  color: var(--jpt-warning);
  font-size: 10.5px;
  line-height: 1.45;
  border: 1px solid #f3e5be;
}

.jpt-pages-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 16px;
}
.jpt-pages-toolbar .jpt-field { min-width: 240px; flex: 1 1 340px; }
.jpt-page-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding: 4px;
}
.jpt-page-chip {
  border: 1px solid var(--jpt-line);
  background: #fff;
  border-radius: 10px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px 7px 10px;
  cursor: grab;
  font-size: 11px;
  color: #31463e;
}
.jpt-page-chip.jpt-dragging { opacity: .4; }
.jpt-page-chip strong { font-size: 11px; }
.jpt-page-chip button { appearance: none; border: 0; background: transparent; color: #9b6666; cursor: pointer; font-size: 14px; line-height: 1; }

.jpt-compress-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 16px;
}
.jpt-mode {
  position: relative;
  border: 1px solid var(--jpt-line);
  border-radius: 13px;
  padding: 13px;
  background: #fff;
  cursor: pointer;
  min-height: 104px;
}
.jpt-mode input { position: absolute; opacity: 0; pointer-events: none; }
.jpt-mode:has(input:checked) { border-color: rgba(43,139,107,.50); box-shadow: 0 0 0 3px rgba(43,139,107,.08); background: #fbfefd; }
.jpt-mode strong { display: block; color: var(--jpt-green-950); font-size: 12px; margin-bottom: 5px; }
.jpt-mode p { margin: 0; color: var(--jpt-muted); font-size: 10.5px; line-height: 1.4; }
.jpt-mode-badge { display: inline-flex; margin-top: 8px; border-radius: 999px; padding: 4px 7px; background: #f0f5f3; color: #587068; font-size: 9px; font-weight: 700; }

.jpt-result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  margin-top: 10px;
}
.jpt-stat { background: #fff; border: 1px solid var(--jpt-line); border-radius: 10px; padding: 10px; }
.jpt-stat small { display: block; color: var(--jpt-muted); font-size: 9px; margin-bottom: 3px; }
.jpt-stat strong { color: var(--jpt-green-950); font-size: 12px; }

.jpt-standalone { min-height: 400px; }
.jpt-standalone > .jpt-standalone-shell { color: var(--jpt-ink); }
.jpt-standalone .jpt-shell { position: relative; width: 100%; max-width: none; height: auto; min-height: 720px; box-shadow: none; border: 1px solid var(--jpt-line); border-radius: 18px; overflow: hidden; transform: none; }
.jpt-standalone .jpt-main { overflow: visible; }
.jpt-standalone .jpt-close { display: none; }

@media (max-width: 900px) {
  .jpt-tool-tabs { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .jpt-options { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .jpt-compress-modes { grid-template-columns: 1fr; }
  .jpt-shell { width: 100vw; }
}

@media (max-width: 620px) {
  .jpt-header { padding: 17px 16px; }
  .jpt-main { padding: 16px 12px 30px; }
  .jpt-tool-tabs { gap: 8px; }
  .jpt-tool-tab { min-height: 78px; padding: 10px; }
  .jpt-tab-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .jpt-tab-copy small { display: none; }
  .jpt-panel-head { padding: 17px 16px 14px; }
  .jpt-panel-body { padding: 16px; }
  .jpt-options { grid-template-columns: 1fr; }
  .jpt-action-row { align-items: stretch; flex-direction: column; }
  .jpt-actions { width: 100%; }
  .jpt-actions .jpt-btn { flex: 1 1 auto; }
  .jpt-result-stats { grid-template-columns: 1fr; }
  .jpt-file-actions .jpt-mini-btn:not(.jpt-danger) { display: none; }
}

/* v1.1 — resultados locais e ações por arquivo */
.jpt-result-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.jpt-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 10px 9px 13px;
  border: 1px solid var(--jpt-line);
  background: #fbfdfc;
  border-radius: 12px;
}
.jpt-result-row .jpt-result-download { flex: 0 0 auto; min-height: 36px; }
.jpt-page-actions { display: inline-flex; align-items: center; gap: 4px; }
.jpt-page-actions button:first-child { color: var(--jpt-green-700); font-size: 16px; }
.jpt-file-row .jpt-file-meta small { overflow-wrap: anywhere; }

@media (max-width: 620px) {
  .jpt-result-row { align-items: stretch; flex-direction: column; }
  .jpt-result-row .jpt-result-download { width: 100%; }
}

/* v1.3 — acesso legível e links persistentes para os arquivos gerados */
.jpt-plan-strip { padding: 14px 18px; margin: 0 0 18px; border: 1px solid #d4e9dd; border-radius: 12px; background: #f3faf5; color: #234c38; line-height: 1.5; }
.jpt-plan-strip a { display: inline-block; margin-left: 12px; font-weight: 700; color: #146941; text-decoration: underline; }
.jpt-free-badge { font-style: normal; font-size: 11px; font-weight: 700; color: #146941; background: #e8f6ed; border-radius: 999px; padding: 3px 7px; }
.jpt-ready-download { display: inline-flex; margin-top: 10px; text-decoration: none; overflow-wrap: anywhere; }
.jpt-download-set { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 12px; }
.jpt-download-set a { text-decoration: none; }
