/* [pres-report-engine-v1] The "Enhanced report" picker (design reference page 11): dark by default, light under
   :root[data-theme="light"]. */
.rpk-overlay {
  --rpk-bg: #17181c;
  --rpk-panel: #202227;
  --rpk-field: #2a2c33;
  --rpk-line: #34363e;
  --rpk-text: #f2f2f4;
  --rpk-dim: #a3a6b0;
  --rpk-accent: #e0954a;
  --rpk-accent-ink: #1b1206;
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 9, 12, 0.6);
  backdrop-filter: blur(3px);
  font-family: inherit;
}
:root[data-theme="light"] .rpk-overlay {
  --rpk-bg: #ffffff;
  --rpk-panel: #f6f6f8;
  --rpk-field: #f0f1f4;
  --rpk-line: #dfe1e7;
  --rpk-text: #1b1d24;
  --rpk-dim: #646a78;
  --rpk-accent: #c96f1c;
  --rpk-accent-ink: #ffffff;
  background: rgba(20, 22, 30, 0.38);
}
.rpk {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 26px;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 26px 28px;
  border-radius: 18px;
  background: var(--rpk-bg);
  color: var(--rpk-text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
}
.rpk h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}
.rpk-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.rpk-dim {
  margin: 4px 0 0;
  color: var(--rpk-dim);
  font-size: 13px;
}
.rpk-x {
  border: 0;
  background: transparent;
  color: var(--rpk-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}
.rpk-x:hover {
  color: var(--rpk-text);
  background: var(--rpk-field);
}
.rpk-label {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.rpk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.rpk-tpl {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rpk-text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.rpk-thumb {
  display: block;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s ease, transform 0.15s ease;
}
.rpk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 36%; /* the cover's title band */
  display: block;
}
.rpk-tpl:hover .rpk-thumb {
  transform: translateY(-1px);
}
.rpk-tpl.rpk-on .rpk-thumb {
  outline-color: var(--rpk-accent);
}
.rpk-tpl:focus-visible {
  outline: none;
}
.rpk-tpl:focus-visible .rpk-thumb {
  outline-color: var(--rpk-text);
}
.rpk-tname {
  font-size: 12px;
  color: var(--rpk-dim);
}
.rpk-tpl.rpk-on .rpk-tname {
  color: var(--rpk-text);
  font-weight: 600;
}
.rpk-logo-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.rpk-drop {
  flex: none;
  width: 92px;
  height: 64px;
  border-radius: 10px;
  border: 1.5px dashed var(--rpk-line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--rpk-dim);
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
  background: var(--rpk-panel);
}
.rpk-drop.rpk-over,
.rpk-drop:focus-visible {
  border-color: var(--rpk-accent);
  outline: none;
}
.rpk-drop img {
  max-width: 80px;
  max-height: 52px;
  object-fit: contain;
  display: block;
}
.rpk-logo-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.rpk-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
}
.rpk-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.rpk-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 20px;
  background: var(--rpk-line);
  transition: background 0.15s ease;
}
.rpk-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.rpk-switch input:checked + .rpk-track {
  background: var(--rpk-accent);
}
.rpk-switch input:checked + .rpk-track::after {
  transform: translateX(14px);
}
.rpk-switch input:focus-visible + .rpk-track {
  outline: 2px solid var(--rpk-text);
  outline-offset: 2px;
}
.rpk-switch input:disabled ~ span {
  opacity: 0.5;
}
.rpk-swatches {
  display: flex;
  gap: 5px;
}
.rpk-swatches i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.rpk-kit {
  font-size: 12px;
  color: var(--rpk-dim);
}
.rpk-kit select {
  margin-left: 4px;
  background: var(--rpk-field);
  color: var(--rpk-text);
  border: 1px solid var(--rpk-line);
  border-radius: 7px;
  padding: 2px 6px;
  font: inherit;
}
.rpk-err {
  margin: 0;
  font-size: 12px;
  color: #ff8b8b;
}
:root[data-theme="light"] .rpk-err {
  color: #b42318;
}
.rpk-field {
  display: block;
  margin-bottom: 8px;
  padding: 7px 12px 8px;
  border-radius: 10px;
  background: var(--rpk-field);
  border: 1px solid transparent;
}
.rpk-field:focus-within {
  border-color: var(--rpk-accent);
}
.rpk-field span {
  display: block;
  font-size: 11px;
  color: var(--rpk-dim);
}
.rpk-field input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--rpk-text);
  font: inherit;
  font-size: 14px;
  padding: 2px 0 0;
}
.rpk-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--rpk-field);
}
.rpk-seg button {
  border: 0;
  border-radius: 7px;
  padding: 8px 6px;
  background: transparent;
  color: var(--rpk-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.rpk-seg button.rpk-on {
  background: var(--rpk-accent);
  color: var(--rpk-accent-ink);
  font-weight: 600;
}
.rpk-seg button:focus-visible,
.rpk-build:focus-visible {
  outline: 2px solid var(--rpk-text);
  outline-offset: 2px;
}
.rpk-build {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 0;
  border-radius: 11px;
  background: var(--rpk-accent);
  color: var(--rpk-accent-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.rpk-build:hover {
  filter: brightness(1.06);
}
.rpk-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.rpk-side .rpk-label {
  margin-top: 0;
}
.rpk-paper {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  border-radius: 12px;
  overflow: hidden;
  background: var(--rpk-panel);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.6);
}
.rpk-paper iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 794px;
  height: 1123px;
  border: 0;
  transform-origin: 0 0;
  transform: scale(0.42); /* report_picker.js fits it to the paper's width */
  pointer-events: none;
  background: #fff;
}
.rpk-busy {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: rpk-sheen 1.2s linear infinite;
}
@keyframes rpk-sheen {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}
.rpk-note {
  margin-top: 10px;
}
@media (max-width: 760px) {
  .rpk {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .rpk-side {
    order: -1;
    max-width: 260px;
  }
  .rpk-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .rpk-thumb,
  .rpk-track,
  .rpk-track::after {
    transition: none;
  }
  .rpk-busy {
    animation: none;
  }
}

/* [pres-report-custom-v1] the logo that is on can be taken off; "No logo" leaves it out of the report */
.rpk-logo-have {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
}
.rpk-logo-nm {
  min-width: 0;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--rpk-text);
}
.rpk-link {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rpk-accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.rpk-drop.rpk-off {
  opacity: 0.4;
  pointer-events: none;
}

/* [pres-report-custom-v1] Customize report: the button under a finished report in the chat (the chat's own colours) */
.rpk-custom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 2px;
}
.rpk-custom-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9em;
  cursor: pointer;
}
.rpk-custom-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.rpk-custom-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.rpk-custom-err {
  color: var(--bad);
  font-size: 0.88em;
}
