/* JIARON default theme — reusable components.
   Anatomy ported from the Sellzy reference: flat surfaces, 1rem card radius,
   pill buttons that carry a colored shadow at rest and drop it on hover, and
   the signature scale+rotate product image hover. */

/* ============================================================
   Icons
   ============================================================ */
.jr-icon {
  display: block;
  flex-shrink: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.jr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--jr-r-pill);
  border: 1px solid transparent;
  font-family: var(--jr-font-body);
  font-weight: 600;
  font-size: var(--jr-text-sm);
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--jr-dur) var(--jr-ease),
    color var(--jr-dur) var(--jr-ease),
    border-color var(--jr-dur) var(--jr-ease),
    box-shadow var(--jr-dur) var(--jr-ease);
}

.jr-btn:disabled,
.jr-btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.jr-btn--primary {
  background: var(--jr-primary);
  color: var(--jr-on-primary);
  box-shadow: var(--jr-shadow-primary);
}

.jr-btn--primary:hover {
  background: var(--jr-primary-dark);
  color: var(--jr-on-primary);
  box-shadow: none;
}

.jr-btn--dark {
  background: var(--jr-gray-800);
  color: var(--jr-white);
  box-shadow: var(--jr-z8);
}

.jr-btn--dark:hover {
  background: var(--jr-gray-900);
  color: var(--jr-white);
  box-shadow: none;
}

.jr-btn--accent {
  background: var(--jr-accent);
  color: var(--jr-on-accent);
  box-shadow: var(--jr-z8);
}

.jr-btn--accent:hover {
  background: var(--jr-accent-dark);
  color: var(--jr-on-accent);
  box-shadow: none;
}

.jr-btn--ghost {
  background: transparent;
  border-color: var(--jr-line);
  color: var(--jr-ink);
}

.jr-btn--ghost:hover {
  color: var(--jr-primary);
  border-color: var(--jr-primary);
  background: var(--jr-primary-veil);
}

.jr-btn--ghost.is-active {
  color: var(--jr-primary);
  border-color: var(--jr-primary);
  background: var(--jr-primary-veil);
}

.jr-btn--sm {
  padding: 0.45rem 1rem;
  font-size: var(--jr-text-xs);
}

.jr-btn--lg {
  padding: 0.85rem 1.75rem;
  font-size: var(--jr-text-base);
}

.jr-btn--block {
  width: 100%;
}

/* Sellzy arrow-chip: sits inside a pill button and straightens on hover. */
.jr-btn__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--jr-r-pill);
  background: var(--jr-white);
  color: var(--jr-primary-darker);
  transform: rotate(-40deg);
  transition: transform var(--jr-dur) var(--jr-ease);
}

.jr-btn:hover .jr-btn__chip {
  transform: none;
}

.jr-btn--lg:has(.jr-btn__chip) {
  padding: 0.5rem 0.75rem 0.5rem 1.5rem;
}

/* ============================================================
   Icon buttons
   ============================================================ */
.jr-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--jr-line);
  background: var(--jr-white);
  border-radius: var(--jr-r-pill);
  color: var(--jr-ink);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition:
    border-color var(--jr-dur) var(--jr-ease),
    background var(--jr-dur) var(--jr-ease),
    color var(--jr-dur) var(--jr-ease);
}

.jr-icon-btn:hover {
  border-color: var(--jr-primary);
  color: var(--jr-primary);
  background: var(--jr-primary-veil);
}

.jr-icon-btn--muted {
  width: 2rem;
  height: 2rem;
  border-color: transparent;
  background: color-mix(in srgb, var(--jr-gray-500) 10%, transparent);
  color: var(--jr-muted);
}

.jr-icon-btn--muted:hover {
  color: var(--jr-error);
  background: color-mix(in srgb, var(--jr-error) 10%, transparent);
  border-color: transparent;
}

.jr-icon-btn--solid {
  background: var(--jr-error);
  border-color: var(--jr-error);
  color: var(--jr-white);
}

.jr-icon-btn--solid:hover {
  background: color-mix(in srgb, var(--jr-error) 85%, #000);
  border-color: transparent;
  color: var(--jr-white);
}

.jr-icon-btn.is-active {
  background: var(--jr-error);
  border-color: var(--jr-error);
  color: var(--jr-white);
}

/* ============================================================
   Badges & chips
   ============================================================ */
.jr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: var(--jr-r-pill);
  font-size: var(--jr-text-xs);
  line-height: var(--jr-text-xs-lh);
  font-weight: 600;
}

.jr-badge--warning {
  background: var(--jr-warning);
  color: var(--jr-gray-900);
}

.jr-badge--success {
  background: var(--jr-success-light);
  color: var(--jr-gray-900);
}

.jr-badge--error {
  background: var(--jr-error);
  color: var(--jr-white);
}

.jr-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  border-radius: var(--jr-r-pill);
  border: 1px solid var(--jr-line);
  text-decoration: none;
  font-size: var(--jr-text-sm);
  font-weight: 500;
  color: var(--jr-muted);
  background: var(--jr-white);
  cursor: pointer;
  transition:
    color var(--jr-dur) var(--jr-ease),
    background var(--jr-dur) var(--jr-ease),
    border-color var(--jr-dur) var(--jr-ease);
}

.jr-chip:hover {
  color: var(--jr-primary);
  border-color: var(--jr-primary);
  background: var(--jr-primary-veil);
}

.jr-chip.is-active {
  color: var(--jr-on-primary);
  background: var(--jr-primary);
  border-color: var(--jr-primary);
}

.jr-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.25rem;
  max-width: 100%;
}

/* ============================================================
   Star rating — only ever rendered when real review data exists
   ============================================================ */
.jr-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--jr-text-sm);
  line-height: var(--jr-text-sm-lh);
}

.jr-rating__stars {
  position: relative;
  display: inline-block;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  line-height: 1;
  color: var(--jr-gray-400);
}

.jr-rating__stars::before {
  content: "★★★★★";
}

.jr-rating__fill {
  position: absolute;
  inset: 0;
  width: var(--jr-rating-pct, 0%);
  overflow: hidden;
  white-space: nowrap;
  color: var(--jr-warning);
}

.jr-rating__fill::before {
  content: "★★★★★";
}

.jr-rating__count {
  color: var(--jr-muted);
  font-size: var(--jr-text-sm);
}

/* ============================================================
   Product card
   ============================================================ */
.jr-product {
  display: flex;
  flex-direction: column;
  background: var(--jr-white);
  border: 1px solid var(--jr-line);
  border-radius: var(--jr-r-card);
  padding: 1rem;
  transition:
    border-color var(--jr-dur) var(--jr-ease),
    box-shadow var(--jr-dur) var(--jr-ease);
}

.jr-product:hover {
  border-color: var(--jr-primary-line);
  box-shadow: var(--jr-z12);
}

.jr-product__media {
  position: relative;
  border-radius: var(--jr-r-media);
  background: var(--jr-plate);
  overflow: hidden;
  margin-bottom: 1rem;
}

.jr-product__video-badge {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.jr-product__media-link {
  display: block;
  aspect-ratio: 1;
}

.jr-product__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8%;
  transition: transform var(--jr-dur) var(--jr-ease);
}

/* The signature Sellzy move. */
.jr-product:hover .jr-product__media img {
  transform: scale(1.1) rotate(-3deg);
}

.jr-product__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--jr-disabled);
  font-size: var(--jr-text-sm);
}

.jr-product__badge {
  position: absolute;
  top: 0.7rem;
  left: 0;
  z-index: 2;
  padding: 0 0.4rem;
  background: var(--jr-error);
  color: var(--jr-warning-lighter);
  font-size: var(--jr-text-sm);
  line-height: var(--jr-text-sm-lh);
  font-weight: 500;
}

.jr-product__badge::after {
  content: "";
  position: absolute;
  top: 0;
  left: 100%;
  width: 0;
  height: 100%;
  border-style: solid;
  border-width: 11px 0 11px 5px;
  border-color: transparent transparent transparent var(--jr-error);
}

.jr-product__badge--sold {
  background: var(--jr-ink-2);
}

.jr-product__badge--sold::after {
  border-color: transparent transparent transparent var(--jr-ink-2);
}

.jr-product--sold-out .jr-product__media img {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.jr-product--sold-out .jr-product__name {
  color: var(--jr-muted);
}

/* Hover action bar */
.jr-product__actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 1px;
  opacity: 0;
  transition:
    opacity var(--jr-dur) var(--jr-ease),
    bottom var(--jr-dur) var(--jr-ease);
}

.jr-product:hover .jr-product__actions,
.jr-product:focus-within .jr-product__actions {
  opacity: 1;
  bottom: 0.75rem;
}

.jr-product__action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  padding: 0;
  background: var(--jr-white);
  color: var(--jr-ink-2);
  cursor: pointer;
  transition: color var(--jr-dur) var(--jr-ease);
}

.jr-product__action:first-child {
  border-radius: var(--jr-r-xs) 0 0 var(--jr-r-xs);
}

.jr-product__action:last-child {
  border-radius: 0 var(--jr-r-xs) var(--jr-r-xs) 0;
}

.jr-product__action:hover {
  color: var(--jr-primary);
}

.jr-product__action.is-active {
  color: var(--jr-error);
}

/* CSS-only tooltip built from the accessible label. */
.jr-product__action::after {
  content: attr(aria-label);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.25rem;
  padding: 3px 8px;
  border-radius: var(--jr-r-xs);
  background: var(--jr-gray-800);
  color: var(--jr-white);
  font-size: var(--jr-text-xs);
  line-height: var(--jr-text-xs-lh);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--jr-dur) var(--jr-ease),
    transform var(--jr-dur) var(--jr-ease);
}

.jr-product__action:hover::after,
.jr-product__action:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-0.35rem);
}

.jr-product__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.jr-product__name {
  font-family: var(--jr-font-body);
  font-size: var(--jr-text-base);
  line-height: 1.5;
  font-weight: 600;
  color: var(--jr-ink);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jr-product__name:hover {
  color: var(--jr-primary);
}

.jr-product__buy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.jr-product__buy .jr-btn {
  flex: 1;
}

.jr-product__buy .jr-icon-btn {
  flex: none;
}

@media (max-width: 379px) {
  .jr-product {
    padding: 0.75rem;
  }

  .jr-product__buy .jr-icon-btn {
    display: none;
  }
}

@media (hover: none) {
  .jr-product:hover .jr-product__media img {
    transform: none;
  }

  .jr-product__actions {
    opacity: 1;
    bottom: 0.5rem;
  }

  .jr-product__action::after {
    display: none;
  }
}

/* ============================================================
   Price
   ============================================================ */
.jr-price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.jr-price__now {
  font-size: var(--jr-text-base);
  font-weight: 600;
  color: var(--jr-ink);
}

.jr-price__was {
  font-size: var(--jr-text-sm);
  line-height: var(--jr-text-sm-lh);
  font-weight: 400;
  color: var(--jr-disabled);
  text-decoration: line-through;
}

.jr-price__off {
  font-size: var(--jr-text-sm);
  line-height: var(--jr-text-sm-lh);
  font-weight: 600;
  color: var(--jr-error);
}

/* ============================================================
   Quantity stepper
   ============================================================ */
.jr-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--jr-line);
  border-radius: var(--jr-r-pill);
  padding: 0.2rem 0.35rem;
  background: var(--jr-white);
}

.jr-qty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: none;
  background: transparent;
  color: var(--jr-ink);
  border-radius: var(--jr-r-pill);
  cursor: pointer;
  transition:
    color var(--jr-dur) var(--jr-ease),
    background var(--jr-dur) var(--jr-ease);
}

.jr-qty__btn:hover {
  color: var(--jr-primary);
  background: var(--jr-primary-tint);
}

.jr-qty__value {
  min-width: 1.75rem;
  text-align: center;
  font-weight: 600;
  font-size: var(--jr-text-sm);
}

/* ============================================================
   Category tile
   ============================================================ */
.jr-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--jr-ink);
  text-align: center;
  min-width: 0;
}

.jr-cat:hover {
  color: var(--jr-primary);
}

.jr-cat__media {
  width: 100%;
  aspect-ratio: 1;
  max-width: 9rem;
  border-radius: var(--jr-r-pill);
  background: var(--jr-plate);
  overflow: hidden;
  display: grid;
  place-items: center;
  transition:
    background var(--jr-dur) var(--jr-ease),
    transform var(--jr-dur) var(--jr-ease);
}

.jr-cat:hover .jr-cat__media {
  background: var(--jr-primary-veil);
  transform: translateY(-4px);
}

.jr-cat__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18%;
  transition: transform var(--jr-dur) var(--jr-ease);
}

.jr-cat:hover .jr-cat__media img {
  transform: scale(1.08);
}

.jr-cat__letter {
  font-family: var(--jr-font-display);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--jr-primary);
}

.jr-cat__name {
  font-size: var(--jr-text-sm);
  line-height: var(--jr-text-sm-lh);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ============================================================
   Forms
   ============================================================ */
.jr-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.jr-field label {
  display: block;
  font-size: var(--jr-text-sm);
  font-weight: 600;
  color: var(--jr-ink);
  margin-bottom: 0.35rem;
}

.jr-field input,
.jr-field select,
.jr-field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--jr-line);
  border-radius: var(--jr-r-media);
  background: var(--jr-white);
  color: var(--jr-ink);
  font-family: var(--jr-font-body);
  font-size: var(--jr-text-sm);
  transition:
    border-color var(--jr-dur) var(--jr-ease),
    box-shadow var(--jr-dur) var(--jr-ease);
}

.jr-field input:focus,
.jr-field select:focus,
.jr-field textarea:focus {
  outline: none;
  border-color: var(--jr-primary);
  box-shadow: 0 0 0 3px var(--jr-primary-tint);
}

.jr-form-row {
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 560px) {
  .jr-form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.jr-error {
  padding: 0.75rem 0.9rem;
  border-radius: var(--jr-r-md);
  background: var(--jr-error-lighter);
  color: var(--jr-error);
  font-size: var(--jr-text-sm);
}

.jr-error[hidden] {
  display: none;
}

.jr-code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.jr-code-row input {
  flex: 1 1 10rem;
  min-width: 0;
}

/* ============================================================
   Tabs
   ============================================================ */
.jr-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 2rem;
  padding-bottom: 0.25rem;
}

.jr-tabs::-webkit-scrollbar {
  display: none;
}

.jr-tabpanel[hidden] {
  display: none;
}

/* ============================================================
   Empty states, pagination, toast
   ============================================================ */
.jr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: clamp(2.5rem, 8vw, 4rem) 1rem;
  background: var(--jr-white);
  border: 1px dashed var(--jr-line);
  border-radius: var(--jr-r-card);
}

.jr-empty__icon {
  width: 4rem;
  height: 4rem;
  border-radius: var(--jr-r-pill);
  display: grid;
  place-items: center;
  color: var(--jr-primary);
  background: var(--jr-primary-veil);
}

.jr-empty__icon--success {
  color: var(--jr-success);
  background: var(--jr-success-lighter);
}

.jr-pagination {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.jr-pagination a,
.jr-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: var(--jr-r-pill);
  border: 1px solid var(--jr-line);
  color: var(--jr-muted);
  font-size: var(--jr-text-sm);
  font-weight: 600;
  text-decoration: none;
  background: var(--jr-white);
  transition:
    color var(--jr-dur) var(--jr-ease),
    background var(--jr-dur) var(--jr-ease),
    border-color var(--jr-dur) var(--jr-ease);
}

.jr-pagination a:hover {
  color: var(--jr-primary);
  border-color: var(--jr-primary);
}

.jr-pagination .is-current {
  color: var(--jr-on-primary);
  background: var(--jr-primary);
  border-color: var(--jr-primary);
}

.jr-pagination .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.jr-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: var(--jr-z-toast);
  padding: 0.8rem 1.15rem;
  border-radius: var(--jr-r-md);
  background: var(--jr-gray-800);
  color: var(--jr-white);
  font-size: var(--jr-text-sm);
  font-weight: 600;
  box-shadow: var(--jr-z-dark);
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  transition:
    opacity var(--jr-dur) var(--jr-ease),
    transform var(--jr-dur) var(--jr-ease);
}

.jr-toast.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 480px) {
  .jr-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/*
 * Website-editor canvas affordances. Scoped to `.jr-embedded-preview`, which the
 * layout only sets inside the editor's iframe, so a shopper never sees them.
 * Outlines are drawn with box-shadow rather than border/outline so a full-bleed
 * section keeps its exact geometry — a 2px border here would reflow the page and
 * make the canvas disagree with the published result.
 */
.jr-embedded-preview [data-jr-section] {
  cursor: pointer;
  transition: box-shadow 120ms ease, opacity 120ms ease;
}

/* The overlay label is absolutely positioned, so a marked block needs to be a
   containing block — except chrome that positions itself. Forcing `relative`
   onto the sticky header would un-stick it, and a header that scrolls away in
   the canvas but not on the shop is exactly the disagreement this whole preview
   exists to avoid. Sticky and fixed are already containing blocks anyway. */
.jr-embedded-preview [data-jr-section]:not([data-jr-chrome]) {
  position: relative;
}

.jr-embedded-preview [data-jr-section].jr-edit-hover {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--jr-primary) 55%, transparent);
}

.jr-embedded-preview [data-jr-section].jr-edit-selected {
  box-shadow: inset 0 0 0 3px var(--jr-primary);
}

/*
 * Name tag on the selected block. Reads `data-jr-label`, which the bridge fills
 * from the editor's own section names — `data-jr-section` is an internal key
 * ("limitedTime", "ctaBand") and showing it to a merchant explains nothing.
 */
.jr-embedded-preview [data-jr-section].jr-edit-selected::after {
  content: attr(data-jr-label);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  padding: 0.15rem 0.5rem;
  font: 600 11px/1.6 system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--jr-primary);
  border-bottom-right-radius: 6px;
  pointer-events: none;
}

.jr-embedded-preview [data-jr-section]:not([data-jr-label]).jr-edit-selected::after {
  content: attr(data-jr-section);
}

/*
 * A section the merchant has switched off but not yet saved. It still renders —
 * removing it would need a round trip, and a block that vanishes before the save
 * lies about what is published — so it is struck through instead, with a ribbon
 * saying the state is pending.
 */
.jr-embedded-preview [data-jr-section].jr-edit-pending-hidden {
  opacity: 0.35;
  filter: grayscale(1);
  box-shadow: inset 0 0 0 2px rgba(120, 120, 120, 0.55);
}

.jr-embedded-preview [data-jr-section].jr-edit-pending-hidden::before {
  content: "Hidden — save to apply";
  position: absolute;
  top: 0;
  right: 0;
  z-index: 30;
  padding: 0.15rem 0.5rem;
  font: 600 11px/1.6 system-ui, sans-serif;
  color: #fff;
  background: #4b5563;
  border-bottom-left-radius: 6px;
  pointer-events: none;
}

/* Browse mode: the merchant is clicking through the shop, not editing it. */
.jr-embedded-preview.jr-edit-browsing [data-jr-section] {
  cursor: auto;
  box-shadow: none;
}

/* ------------------------------------------------------------------ *
 * Block toolbar
 *
 * Injected once by the bridge and moved to whichever block is under the
 * pointer. `--jr-edit-zoom` counter-scales it: the editor lays this frame out
 * at a real device width and shrinks it to fit the column, so at 55% an
 * un-scaled toolbar would render at 15px and be unusable.
 * ------------------------------------------------------------------ */
.jr-edit-ui {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
}

.jr-edit-bar {
  --jr-edit-zoom: 1;
  position: fixed;
  top: -999px;
  left: -999px;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 8px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  transform: scale(var(--jr-edit-zoom));
  transform-origin: top left;
  white-space: nowrap;
}

.jr-edit-ui.is-on .jr-edit-bar {
  display: flex;
}

.jr-edit-bar__label {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 600 11px/1.8 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  padding-right: 4px;
}

.jr-edit-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  fill: currentColor;
}

.jr-edit-bar__btn[hidden] {
  display: none;
}

.jr-edit-bar__btn:hover,
.jr-edit-bar__btn:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  outline: none;
}

.jr-edit-bar__btn--ai:hover {
  background: var(--jr-primary, #6d28d9);
}

.jr-edit-bar__btn--add {
  color: #86efac;
}

/* ---- Canvas: drag to reorder ---- */
.jr-edit-bar__btn--drag {
  cursor: grab;
  color: #9ca3af;
  touch-action: none;
}

.jr-edit-bar__btn--style {
  color: #c4b5fd;
}

.jr-embedded-preview.jr-edit-dragging,
.jr-embedded-preview.jr-edit-dragging .jr-edit-bar__btn--drag {
  cursor: grabbing;
}

/* Nothing on the page should select or navigate while a block is in flight. */
.jr-embedded-preview.jr-edit-dragging {
  user-select: none;
}

.jr-edit-drop {
  position: fixed;
  height: 3px;
  margin-top: -1px;
  border-radius: 3px;
  background: #6d28d9;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.jr-edit-drop.is-on {
  opacity: 1;
}

/* ---- Canvas: editing text in place ---- */
.jr-embedded-preview [data-jr-field] {
  cursor: text;
}

.jr-embedded-preview.jr-edit-browsing [data-jr-field] {
  cursor: inherit;
}

.jr-embedded-preview [data-jr-field]:hover {
  outline: 1px dashed rgba(109, 40, 217, 0.55);
  outline-offset: 3px;
}

.jr-embedded-preview .jr-edit-typing,
.jr-embedded-preview .jr-edit-typing:hover {
  outline: 2px solid #6d28d9;
  outline-offset: 3px;
  border-radius: 3px;
  background: rgba(109, 40, 217, 0.06);
}
