/*
 * CompareGo consumer offer selection
 * Attach the selection surface inside #flyerPdfViewer. All component selectors
 * are prefixed so this file can be loaded without changing the existing viewer.
 */

#flyerPdfViewer {
  --consumer-offer-ink: #173c45;
  --consumer-offer-muted: #526b70;
  --consumer-offer-teal: #0b4f5d;
  --consumer-offer-teal-hover: #083f4b;
  --consumer-offer-gold: #e6c36f;
  --consumer-offer-border: #d5e1e1;
  --consumer-offer-surface: #ffffff;
  --consumer-offer-soft: #f3f8f7;
  --consumer-offer-danger: #a4362c;
  --consumer-offer-radius: 16px;
  --consumer-offer-shadow: 0 18px 55px rgba(12, 47, 55, 0.24);
}

.consumer-offer-backdrop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: rgba(10, 34, 40, 0.66);
  color: var(--consumer-offer-ink, #173c45);
  overscroll-behavior: contain;
}

.consumer-offer-backdrop[hidden],
.consumer-offer-panel[hidden] {
  display: none;
}

.consumer-offer-panel {
  display: flex;
  width: min(100%, 1280px);
  min-width: 0;
  max-height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: var(--consumer-offer-surface, #fff);
  box-shadow: var(--consumer-offer-shadow, 0 18px 55px rgba(12, 47, 55, .24));
}

.consumer-offer-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--consumer-offer-border, #d5e1e1);
  background: var(--consumer-offer-surface, #fff);
}

.consumer-offer-heading {
  min-width: 0;
  margin: 0;
  color: var(--consumer-offer-ink, #173c45);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.consumer-offer-subheading {
  margin: 3px 0 0;
  color: var(--consumer-offer-muted, #526b70);
  font-size: 12px;
  line-height: 1.35;
}

.consumer-offer-close,
.consumer-offer-toolbar button,
.consumer-offer-action {
  min-height: 44px;
  border: 1px solid var(--consumer-offer-border, #d5e1e1);
  border-radius: 10px;
  background: #fff;
  color: var(--consumer-offer-teal, #0b4f5d);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.consumer-offer-close {
  display: inline-grid;
  width: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  font-size: 20px;
}

.consumer-offer-main {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.consumer-offer-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--consumer-offer-border, #d5e1e1);
  background: var(--consumer-offer-soft, #f3f8f7);
}

.consumer-offer-toolbar button {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
}

.consumer-offer-toolbar button[aria-pressed="true"],
.consumer-offer-toolbar button.is-active {
  border-color: var(--consumer-offer-teal, #0b4f5d);
  background: var(--consumer-offer-teal, #0b4f5d);
  color: #fff;
}

.consumer-offer-toolbar button:disabled,
.consumer-offer-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.consumer-offer-hint {
  flex: 1 1 100%;
  margin: 1px 2px 0;
  color: var(--consumer-offer-muted, #526b70);
  font-size: 12px;
  line-height: 1.45;
}

.consumer-offer-workspace {
  display: grid;
  min-height: 230px;
  grid-template-columns: minmax(0, 1fr);
  background: #e8efee;
}

.consumer-offer-pdf-host {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 12px;
  background-color: #e8efee;
  background-image:
    linear-gradient(45deg, rgba(11, 79, 93, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(11, 79, 93, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(11, 79, 93, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(11, 79, 93, 0.035) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.consumer-offer-pdf-host > #flyerPdfCanvasStage {
  flex: 0 0 auto;
  margin: auto;
}

.consumer-offer-pdf-host .consumer-offer-selection-layer {
  position: absolute;
  z-index: 15;
  inset: 0;
  pointer-events: none;
}

.consumer-offer-selection-box {
  position: absolute;
  min-width: 12px;
  min-height: 12px;
  border: 2px solid var(--consumer-offer-gold, #e6c36f);
  border-radius: 4px;
  background: rgba(230, 195, 111, 0.12);
  box-shadow: 0 0 0 1px rgba(23, 60, 69, 0.5);
  pointer-events: auto;
}

.consumer-offer-selection-box.is-draft {
  border-style: dashed;
}

.consumer-offer-selection-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--consumer-offer-teal, #0b4f5d);
  box-shadow: 0 0 0 1px rgba(23, 60, 69, 0.45);
  touch-action: none;
}

.consumer-offer-selection-handle[data-handle="nw"] { top: -11px; left: -11px; }
.consumer-offer-selection-handle[data-handle="ne"] { top: -11px; right: -11px; }
.consumer-offer-selection-handle[data-handle="sw"] { bottom: -11px; left: -11px; }
.consumer-offer-selection-handle[data-handle="se"] { right: -11px; bottom: -11px; }

.consumer-offer-review {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  background: var(--consumer-offer-surface, #fff);
}

.consumer-offer-crop-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--consumer-offer-border, #d5e1e1);
  border-radius: 12px;
  background: var(--consumer-offer-soft, #f3f8f7);
}

.consumer-offer-crop-title {
  margin: 0;
  color: var(--consumer-offer-ink, #173c45);
  font-size: 13px;
  font-weight: 750;
}

.consumer-offer-crop-preview {
  display: grid;
  min-height: 84px;
  max-height: 168px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed #b9cccc;
  border-radius: 8px;
  background: #fff;
}

.consumer-offer-crop-preview img,
.consumer-offer-crop-preview canvas {
  display: block;
  width: 100%;
  max-height: 168px;
  object-fit: contain;
}

.consumer-offer-crop-empty {
  padding: 14px;
  color: var(--consumer-offer-muted, #526b70);
  font-size: 12px;
  text-align: center;
}

.consumer-offer-form-heading {
  margin: 0;
  color: var(--consumer-offer-ink, #173c45);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
}

.consumer-offer-form-intro {
  margin: -8px 0 0;
  color: var(--consumer-offer-muted, #526b70);
  font-size: 12px;
  line-height: 1.45;
}

.consumer-offer-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}

.consumer-offer-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.consumer-offer-field label {
  color: var(--consumer-offer-ink, #173c45);
  font-size: 12px;
  font-weight: 700;
}

.consumer-offer-field input,
.consumer-offer-field select,
.consumer-offer-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid #b9cccc;
  border-radius: 9px;
  background: #fff;
  color: var(--consumer-offer-ink, #173c45);
  font: inherit;
  font-size: 16px;
}

.consumer-offer-price-input {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #bdcfcc;
  border-radius: 8px;
  background: #fff;
}

.consumer-offer-price-input > span {
  flex: 0 0 auto;
  padding: 0 0 0 11px;
  color: var(--consumer-offer-muted, #526b70);
  font-size: 14px;
  font-weight: 700;
}

.consumer-offer-price-input input {
  min-height: 42px;
  border: 0;
  box-shadow: none !important;
}

.consumer-offer-price-input:focus-within {
  border-color: #bc9a5f;
  box-shadow: 0 0 0 3px rgba(188, 154, 95, 0.16);
}

.consumer-offer-price-input input:focus {
  border: 0 !important;
  outline: 0;
  box-shadow: none !important;
}

.consumer-offer-field--wide {
  grid-column: 1 / -1;
}

.consumer-offer-field-hint {
  margin: 0;
  color: var(--consumer-offer-muted, #526b70);
  font-size: 11px;
  line-height: 1.35;
}

.consumer-offer-field input::placeholder,
.consumer-offer-field textarea::placeholder {
  color: #657b80;
  opacity: 1;
}

.consumer-offer-field input[aria-invalid="true"],
.consumer-offer-field select[aria-invalid="true"] {
  border-color: var(--consumer-offer-danger, #a4362c);
}

.consumer-offer-generic-suggestions:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.consumer-offer-generic-suggestions > span {
  flex: 1 0 100%;
  color: var(--consumer-offer-muted, #526b70);
  font-size: 11px;
}

.consumer-offer-generic-suggestions button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #c5dcdd;
  border-radius: 999px;
  background: #f2f8f7;
  color: var(--consumer-offer-ink, #173c45);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.consumer-offer-field-hint {
  margin: 0;
  color: var(--consumer-offer-muted, #526b70);
  font-size: 11px;
  line-height: 1.4;
}

.consumer-offer-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #c5dcdd;
  border-radius: 10px;
  background: #eff7f6;
  color: var(--consumer-offer-ink, #173c45);
  font-size: 13px;
  line-height: 1.45;
}

.consumer-offer-status.is-error {
  border-color: #d8aaa5;
  background: #fff5f3;
  color: var(--consumer-offer-danger, #a4362c);
}

.consumer-offer-status.is-loading::before {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid #a8c2c4;
  border-top-color: var(--consumer-offer-teal, #0b4f5d);
  border-radius: 50%;
  content: "";
  animation: consumer-offer-turn 0.8s linear infinite;
}

.consumer-offer-actions {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--consumer-offer-border, #d5e1e1);
  background: var(--consumer-offer-surface, #fff);
}

.consumer-offer-action {
  min-height: 48px;
  padding: 10px 16px;
}

.consumer-offer-action--primary {
  flex: 1 1 auto;
  border-color: var(--consumer-offer-teal, #0b4f5d);
  background: var(--consumer-offer-teal, #0b4f5d);
  color: #fff;
}

.consumer-offer-action--primary:hover:not(:disabled) {
  background: var(--consumer-offer-teal-hover, #083f4b);
}

.consumer-offer-action--secondary {
  flex: 0 0 auto;
  min-width: 96px;
}

.consumer-offer-close:hover,
.consumer-offer-toolbar button:hover:not(:disabled),
.consumer-offer-action--secondary:hover:not(:disabled) {
  background: #f1f7f6;
}

.consumer-offer-backdrop :focus-visible {
  outline: 3px solid var(--consumer-offer-gold, #e6c36f);
  outline-offset: 2px;
}

@keyframes consumer-offer-turn {
  to { transform: rotate(360deg); }
}

@media (min-width: 700px) {
  .consumer-offer-backdrop {
    align-items: center;
    padding: 24px;
  }

  .consumer-offer-panel {
    max-height: min(900px, calc(100dvh - 48px));
    border: 1px solid rgba(213, 225, 225, 0.9);
    border-radius: var(--consumer-offer-radius, 16px);
  }

  .consumer-offer-main {
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .consumer-offer-workspace {
    min-height: 0;
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.8fr);
    overflow: hidden;
  }

  .consumer-offer-pdf-host {
    min-height: 0;
  }

  .consumer-offer-review {
    min-height: 0;
    overflow: auto;
    border-left: 1px solid var(--consumer-offer-border, #d5e1e1);
  }

  .consumer-offer-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .consumer-offer-field--wide {
    grid-column: 1 / -1;
  }

  .consumer-offer-actions {
    justify-content: flex-end;
    padding: 12px 18px;
  }

  .consumer-offer-action--primary {
    flex: 0 0 auto;
    min-width: 190px;
  }
}

@media (max-width: 699px) {
  .consumer-offer-backdrop {
    align-items: stretch;
  }

  .consumer-offer-panel {
    max-height: 100%;
  }

  .consumer-offer-main {
    grid-template-rows: auto minmax(220px, 42vh) auto;
  }

  .consumer-offer-workspace {
    display: contents;
  }

  .consumer-offer-pdf-host {
    min-height: 220px;
    max-height: 42vh;
  }

  .consumer-offer-review {
    padding: 14px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consumer-offer-status.is-loading::before {
    animation: none;
    border-top-color: var(--consumer-offer-teal, #0b4f5d);
  }
}

.consumer-offer-pdf-host > .consumer-offer-selector {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 240px;
  overflow: hidden;
}

.consumer-offer-pdf-host {
  overflow: hidden;
}

.consumer-offer-pdf-host .PdfHighlighter {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #e8efee;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.consumer-offer-selector.is-selecting .PdfHighlighter {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.consumer-offer-selector .pdfViewer .page {
  margin: 12px auto;
  box-shadow: 0 3px 18px rgba(23, 60, 69, 0.2);
}

.consumer-offer-selector .PdfHighlighter__highlight-layer {
  z-index: 5;
}

.consumer-offer-selector .PdfHighlighter__tip-container {
  display: none;
}

#consumerOfferSelectionBackdrop .consumer-offer-field details,
#consumerOfferOcrText {
  width: 100%;
}

#consumerOfferReviewForm details > summary {
  color: var(--consumer-offer-ink, #173c45);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#consumerOfferReviewForm details textarea {
  margin-top: 8px;
  resize: vertical;
}

#consumerOfferHeading:focus {
  outline: none;
}

@media (max-width: 699px) {
  .consumer-offer-pdf-host > .consumer-offer-selector {
    min-height: 220px;
  }

/* Manual offer review: sharpen the hierarchy without changing the viewer runtime. */
.consumer-offer-backdrop {
  --consumer-offer-ink: #173c45;
  --consumer-offer-muted: #526b70;
  --consumer-offer-teal: #135063;
  --consumer-offer-teal-hover: #0d414f;
  --consumer-offer-gold: #e2b95e;
  --consumer-offer-border: #cfdddd;
  --consumer-offer-surface: #fbfdfc;
  --consumer-offer-soft: #edf5f3;
  --consumer-offer-danger: #a4362c;
  --consumer-offer-radius: 18px;
  --consumer-offer-shadow: 0 24px 72px rgba(8, 36, 43, 0.32);
  background: rgba(8, 31, 38, 0.76);
  backdrop-filter: blur(5px);
}

.consumer-offer-panel {
  width: min(100%, 1380px);
  background: #fbfdfc;
}

.consumer-offer-header {
  min-height: 76px;
  padding: 14px 22px;
}

.consumer-offer-kicker {
  margin: 0 0 5px;
  color: #52777b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.consumer-offer-heading {
  font-size: 20px;
  letter-spacing: -0.035em;
}

.consumer-offer-subheading {
  max-width: 62ch;
  font-size: 13px;
}

.consumer-offer-main {
  background: #edf3f2;
}

.consumer-offer-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px 22px;
  padding: 12px 20px;
  background: #f7faf9;
}

.consumer-offer-steps {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #6c8081;
  font-size: 10px;
  font-weight: 700;
}

.consumer-offer-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.consumer-offer-step-number {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #c9d7d5;
  border-radius: 50%;
  background: #fff;
  color: #687c7e;
  font-size: 9px;
}

.consumer-offer-step.is-current {
  color: var(--consumer-offer-teal);
}

.consumer-offer-step.is-current .consumer-offer-step-number {
  border-color: var(--consumer-offer-teal);
  background: var(--consumer-offer-teal);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(19, 80, 99, 0.12);
}

.consumer-offer-step.is-complete .consumer-offer-step-number {
  border-color: #9dc5b9;
  background: #e5f2ed;
  color: #135063;
  font-size: 0;
}

.consumer-offer-step.is-complete .consumer-offer-step-number::after {
  content: "✓";
  font-size: 12px;
}

.consumer-offer-step-rule {
  width: clamp(8px, 1.5vw, 22px);
  height: 1px;
  background: #ccd9d7;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-main {
  grid-template-rows: auto minmax(180px, 1fr) auto;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-toolbar {
  gap: 5px 10px;
  padding: 5px 12px;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-steps {
  min-height: 24px;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-review {
  gap: 9px;
  padding-block: 10px;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-form-intro {
  margin-top: -5px;
}

.consumer-offer-toolbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-toolbar {
  grid-template-columns: minmax(0, 1fr);
}

.consumer-offer-backdrop.is-review-only .consumer-offer-toolbar-actions {
  display: none;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-steps {
  justify-content: space-between;
  gap: 12px;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-step-rule {
  width: auto;
  max-width: 56px;
  flex: 1 1 auto;
}

.consumer-offer-toolbar button {
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 9px;
}

.consumer-offer-toolbar #consumerOfferDraw {
  border-color: var(--consumer-offer-teal);
  background: var(--consumer-offer-teal);
  color: #fff;
}

.consumer-offer-toolbar #consumerOfferDraw:hover:not(:disabled) {
  background: var(--consumer-offer-teal-hover);
}

.consumer-offer-toolbar #consumerOfferDraw[aria-pressed="true"] {
  border-color: #947222;
  background: #f1d38b;
  color: #233e43;
}

.consumer-offer-hint {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid #d6b45f;
  background: #f3f6f1;
  font-size: 12px;
}

.consumer-offer-hint strong {
  flex: 0 0 auto;
  color: #365c60;
}

.consumer-offer-workspace {
  background: #e7efed;
}

.consumer-offer-flyer-column {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #e5edeb;
}

.consumer-offer-flyer-label {
  display: flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid #d1ddda;
  background: #f0f5f3;
  color: #315a60;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.consumer-offer-live-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ceaa50;
}

.consumer-offer-flyer-note {
  margin-left: auto;
  color: #6a7f80;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.consumer-offer-pdf-host {
  min-height: 0;
  flex: 1 1 auto;
}

.consumer-offer-pdf-host .PdfHighlighter,
.consumer-offer-pdf-host .consumer-offer-selector {
  background-color: #e5edeb;
}

.consumer-offer-selection-box {
  border: 3px solid #e2b95e;
  border-radius: 5px;
  background: rgba(226, 185, 94, 0.2);
  box-shadow: 0 0 0 2px rgba(19, 80, 99, 0.8), 0 4px 16px rgba(9, 40, 47, 0.18);
}

.consumer-offer-selection-box:not(.is-draft) {
  border-color: #e3b64f;
  background: rgba(241, 203, 112, 0.24);
}

.consumer-offer-selector .AreaHighlight__part {
  border: 3px solid #e2b95e;
  border-radius: 5px;
  background: rgba(241, 203, 112, 0.24);
  box-shadow: 0 0 0 2px rgba(19, 80, 99, 0.82), 0 4px 16px rgba(9, 40, 47, 0.2);
}

.consumer-offer-selector .AreaHighlight {
  cursor: move;
}

.consumer-offer-selection-handle {
  width: 26px;
  height: 26px;
  border-color: #fbfdfc;
  background: #135063;
  box-shadow: 0 0 0 2px #e2b95e, 0 2px 7px rgba(9, 40, 47, 0.35);
}

.consumer-offer-review {
  gap: 12px;
  padding: 18px;
  background: #fbfdfc;
}

.consumer-offer-crop-card {
  gap: 10px;
  padding: 12px;
  border-color: #c9d9d6;
  border-radius: 13px;
  background: #f0f6f4;
}

.consumer-offer-crop-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.consumer-offer-crop-title {
  font-size: 14px;
}

.consumer-offer-reselect-action {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #b9ceca;
  border-radius: 999px;
  background: #fff;
  color: #135063;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.consumer-offer-reselect-action:hover:not(:disabled) {
  border-color: #135063;
  background: #f4f8f7;
}

.consumer-offer-reselect-action:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.consumer-offer-crop-preview {
  min-height: 112px;
  max-height: 264px;
  border-color: #c3d4d1;
  background-color: #fff;
  background-image: linear-gradient(135deg, #f7faf9 25%, transparent 25%),
    linear-gradient(225deg, #f7faf9 25%, transparent 25%),
    linear-gradient(45deg, #f7faf9 25%, transparent 25%),
    linear-gradient(315deg, #f7faf9 25%, #fff 25%);
  background-position: 8px 0, 8px 0, 0 0, 0 0;
  background-size: 16px 16px;
  background-repeat: repeat;
}

.consumer-offer-crop-preview img,
.consumer-offer-crop-preview canvas {
  max-height: 264px;
}

.consumer-offer-crop-preview:has(img) {
  border-style: solid;
  border-color: #93b9b0;
  box-shadow: inset 0 0 0 2px rgba(19, 80, 99, 0.09);
}

.consumer-offer-review-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
}

.consumer-offer-review-index {
  color: #7b9898;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.consumer-offer-form-heading {
  font-size: 16px;
}

.consumer-offer-form-intro {
  margin: -6px 0 0 28px;
  font-size: 12px;
}

.consumer-offer-field label {
  font-size: 12px;
}

.consumer-offer-field input,
.consumer-offer-field select,
.consumer-offer-field textarea {
  border-color: #bdcfcc;
  border-radius: 8px;
  background: #fff;
}

.consumer-offer-field input:hover,
.consumer-offer-field select:hover,
.consumer-offer-field textarea:hover {
  border-color: #8eaaa6;
}

.consumer-offer-status {
  border-color: #c4dcd7;
  background: #edf6f3;
}

.consumer-offer-actions {
  min-height: 72px;
  align-items: center;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -5px 16px rgba(22, 63, 68, 0.045);
}

.consumer-offer-action {
  min-height: 50px;
  border-radius: 10px;
}

.consumer-offer-action--primary {
  letter-spacing: 0.01em;
}

.consumer-offer-action--primary:disabled {
  border-color: #a9c1bd;
  background: #aec4c0;
  color: #f7fbfa;
  opacity: 1;
}

.consumer-offer-close:hover,
.consumer-offer-action--secondary:hover:not(:disabled) {
  border-color: #9cb9b4;
  background: #edf5f3;
}

.consumer-offer-backdrop :focus-visible {
  outline: 3px solid #c99e3f;
  outline-offset: 3px;
}

.consumer-offer-field textarea {
  min-height: 96px;
  line-height: 1.5;
}

@media (min-width: 700px) {
  .consumer-offer-header {
    padding-inline: 24px;
  }

  .consumer-offer-toolbar {
    grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
    padding: 12px 20px;
  }

  .consumer-offer-workspace {
    grid-template-columns: minmax(0, 1.62fr) minmax(360px, 0.78fr);
  }

  .consumer-offer-actions {
    min-height: 76px;
  }
}

@media (max-width: 699px) {
  .consumer-offer-backdrop {
    padding-top: env(safe-area-inset-top);
  }

  .consumer-offer-panel {
    max-height: 100dvh;
  }

  .consumer-offer-header {
    min-height: 70px;
    gap: 8px;
    padding: 11px 14px;
  }

  .consumer-offer-heading {
    font-size: 18px;
  }

  .consumer-offer-subheading {
    font-size: 11px;
  }

  .consumer-offer-main {
    grid-template-rows: auto minmax(190px, 34dvh) auto;
    overflow: auto;
  }

  .consumer-offer-toolbar {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px 14px;
  }

  .consumer-offer-steps {
    justify-content: space-between;
  }

  .consumer-offer-step-rule {
    flex: 1 1 auto;
  }

  .consumer-offer-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .consumer-offer-toolbar button {
    width: 100%;
    min-height: 46px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .consumer-offer-hint {
    gap: 5px;
    padding: 8px 9px;
    font-size: 11px;
    line-height: 1.4;
  }

  .consumer-offer-hint strong {
    white-space: nowrap;
  }

  .consumer-offer-workspace {
    display: contents;
  }

  .consumer-offer-flyer-column {
    min-height: 190px;
  }

  .consumer-offer-flyer-label {
    min-height: 32px;
    padding-inline: 12px;
    font-size: 10px;
  }

  .consumer-offer-flyer-note {
    font-size: 9px;
  }

  .consumer-offer-pdf-host {
    min-height: 158px;
    max-height: 34dvh;
    padding: 6px;
  }

  .consumer-offer-review {
    gap: 10px;
    padding: 12px 14px 14px;
  }

  .consumer-offer-crop-card {
    grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
    align-items: center;
    gap: 6px 10px;
    padding: 9px;
  }

  .consumer-offer-crop-heading {
    display: grid;
    align-content: center;
    justify-items: start;
  }

  .consumer-offer-crop-title {
    font-size: 12px;
  }

  .consumer-offer-crop-preview {
    grid-row: span 2;
    min-height: 76px;
    max-height: 164px;
  }

  .consumer-offer-crop-preview img,
  .consumer-offer-crop-preview canvas {
    max-height: 162px;
  }

  .consumer-offer-crop-empty {
    padding: 8px;
    font-size: 11px;
  }

  .consumer-offer-form-intro {
    margin-left: 0;
  }

  .consumer-offer-fields {
    gap: 9px;
  }

  .consumer-offer-actions {
    min-height: 68px;
    gap: 8px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  }

  .consumer-offer-action {
    min-height: 48px;
    padding-inline: 12px;
  }

  .consumer-offer-action--secondary {
    min-width: 92px;
  }
}

@media (max-width: 360px) {
  .consumer-offer-steps {
    gap: 5px;
    font-size: 10px;
  }

  .consumer-offer-step {
    gap: 4px;
  }

  .consumer-offer-step-number {
    width: 21px;
    height: 21px;
  }

  .consumer-offer-hint {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consumer-offer-backdrop *,
  .consumer-offer-backdrop *::before,
  .consumer-offer-backdrop *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

}

/* The actual PDF page receives the manual selection layer; no second PDF is mounted. */
.comparego-offer-selection-layer {
  position: absolute;
  z-index: 8;
  overflow: visible;
  background: transparent;
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.comparego-offer-selection-layer.is-complete {
  pointer-events: none;
}

.comparego-offer-selection-banner {
  position: absolute;
  z-index: 12000;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(520px, calc(100% - 20px));
  max-width: calc(100% - 20px);
  box-sizing: border-box;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(207, 221, 221, 0.9);
  border-radius: 12px;
  background: rgba(251, 253, 252, 0.97);
  box-shadow: 0 8px 24px rgba(8, 36, 43, 0.2);
  color: #173c45;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  transform: translate(-50%, -50%);
  cursor: default;
  touch-action: manipulation;
}
.comparego-offer-selection-banner[hidden] {
  display: none !important;
}

.comparego-offer-selection-copy {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
}

.comparego-offer-selection-copy strong {
  color: #135063;
  font-size: 12px;
  font-weight: 800;
}

.comparego-offer-selection-copy span {
  color: #526b70;
  font-size: 11px;
}

.comparego-offer-selection-banner button {
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid #cfdddd;
  border-radius: 9px;
  background: #fff;
  color: #135063;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
}

.comparego-offer-selection-banner .comparego-offer-selection-confirm {
  border-color: #135063;
  background: #135063;
  color: #fff;
}

.comparego-offer-selection-banner button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.comparego-offer-selection-layer .consumer-offer-selection-box {
  min-width: 18px;
  min-height: 18px;
  border: 3px solid #e2b95e;
  border-radius: 5px;
  background: rgba(241, 203, 112, 0.2);
  box-shadow: 0 0 0 2px rgba(19, 80, 99, 0.82), 0 4px 16px rgba(9, 40, 47, 0.2);
  cursor: move;
}

.comparego-offer-selection-layer .consumer-offer-selection-box.is-draft {
  border-style: dashed;
  cursor: crosshair;
}

.comparego-offer-selection-layer .consumer-offer-selection-handle {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 3px solid #fbfdfc;
  border-radius: 50%;
  background: #135063;
  box-shadow: 0 0 0 2px #e2b95e, 0 2px 7px rgba(9, 40, 47, 0.35);
  cursor: nwse-resize;
  touch-action: none;
}

.comparego-offer-selection-layer .consumer-offer-selection-handle[data-handle="ne"],
.comparego-offer-selection-layer .consumer-offer-selection-handle[data-handle="sw"] {
  cursor: nesw-resize;
}

.comparego-offer-selection-banner :focus-visible,
.comparego-offer-selection-layer .consumer-offer-selection-handle:focus-visible {
  outline: 3px solid #e2b95e;
  outline-offset: 2px;
}

.flyer-pdf-viewer.is-offer-selection-active #flyerPdfCanvasStage {
  cursor: crosshair;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.consumer-offer-backdrop.is-review-only .consumer-offer-flyer-column[hidden] {
  display: none !important;
}

.consumer-offer-backdrop.is-review-only .consumer-offer-review {
  border-left: 0;
}

.consumer-offer-price-candidate:focus-visible {
  outline: 3px solid #e2b95e;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .comparego-offer-selection-banner {
    display: grid;
    width: min(380px, calc(100% - 12px));
    max-width: calc(100% - 12px);
    grid-template-columns: minmax(0, 1fr) auto;
    top: 50%;
    gap: 6px;
    padding: 6px;
    border-radius: 10px;
  }

  .comparego-offer-selection-copy {
    grid-column: 1 / -1;
    min-width: 0;
    max-width: none;
  }

  .comparego-offer-selection-banner button {
    min-height: 34px;
    padding: 6px 9px;
  }

  .comparego-offer-selection-copy strong {
    font-size: 11px;
  }

  .comparego-offer-selection-copy span {
    font-size: 10px;
  }

  .comparego-offer-selection-banner button {
    min-height: 38px;
    padding-inline: 8px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .comparego-offer-selection-layer *,
  .comparego-offer-selection-layer *::before,
  .comparego-offer-selection-layer *::after {
    animation: none !important;
    transition: none !important;
  }
}
