/* Print-area editor in the workshop product form. */
.ae {
  --ae-accent: #013009;
  --ae-error: #b42318;
  --ae-warn: #a05f00;
  --ae-measure: #0e7490;
  --ae-canvas: #f2f3f6;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin: 14px 0 26px;
  overflow: hidden;
}
.ae-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.ae-tabs button {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.ae-tabs button[aria-pressed='true'] {
  background: var(--active);
  border-color: #b9d6c3;
  color: var(--accent);
  font-weight: 600;
}
.ae-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: none;
}
.ae-dot:is(.is-warn, .is-error) {
  display: block;
}
.ae-dot.is-warn {
  background: var(--ae-warn);
}
.ae-dot.is-error {
  background: var(--ae-error);
}
.ae-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr);
}
.ae-canvas {
  padding: 14px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.ae-side {
  padding: 16px;
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}
.ae-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}
.ae-grow {
  flex: 1;
}
.ae-toolbar .quiet {
  min-height: 34px;
  padding: 6px;
}
.ae-toolbar .quiet .icon {
  width: 19px;
  height: 19px;
}
.ae-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 2px;
  background: var(--work);
}
.ae-seg button {
  min-height: 30px;
  padding: 5px 11px;
  font-size: 11px;
  border: 0;
  background: transparent;
  border-radius: 7px;
}
.ae-seg button[aria-pressed='true'] {
  background: #fff;
  box-shadow: 0 1px 2px #1a1f2b26;
  font-weight: 600;
}
.ae-stage {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--ae-canvas);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.ae-layer {
  position: absolute;
}
.ae-photo,
.ae-sketch,
.ae-sketch > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.ae-missing {
  position: absolute;
  inset: 22%;
  display: grid;
  place-items: center;
  border: 1px dashed #c3c8d1;
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
}
.ae-box {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid var(--ae-accent);
  background: rgba(56, 90, 212, 0.1);
  cursor: move;
  touch-action: none;
  outline: none;
}
.ae-box:focus-visible {
  box-shadow: 0 0 0 3px rgba(102, 130, 238, 0.45);
}
.ae-box.is-outside {
  border-style: dashed;
  border-color: var(--ae-warn);
  background: rgba(160, 95, 0, 0.1);
}
.ae-box.is-error {
  border-color: var(--ae-error);
  background: rgba(180, 35, 24, 0.14);
}
.ae-box.is-preview {
  border-style: dashed;
  background: rgba(56, 90, 212, 0.08);
  pointer-events: none;
}
.ae-max {
  position: absolute;
  border: 1px dashed rgba(56, 90, 212, 0.75);
  border-top: 0;
  pointer-events: none;
}
.ae-max.full-w {
  border-left: 0;
  border-right: 0;
}
.ae-max span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font-size: 10px;
  line-height: 1.2;
  color: #00843d;
  white-space: nowrap;
}
.ae-box:is(.is-small, .is-narrow) .ae-max span {
  display: none;
}
.ae-chip {
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--ae-accent);
  color: #fff;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
/* A small box carries its size label outside, above or below. */
.ae-box.is-small .ae-chip {
  top: auto;
  bottom: calc(100% + 7px);
}
.ae-box.is-small.chip-below .ae-chip {
  bottom: auto;
  top: calc(100% + 7px);
}
.ae-box.is-outside .ae-chip {
  background: var(--ae-warn);
}
.ae-box.is-error .ae-chip {
  background: var(--ae-error);
}
.ae-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: #fff;
  border: 1.5px solid var(--ae-accent);
  border-radius: 3px;
  box-shadow: 0 1px 2px #1a1f2b33;
  touch-action: none;
}
.ae-handle::before {
  content: '';
  position: absolute;
  inset: -9px;
}
.ae-handle[data-ae-handle='nw'] {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}
.ae-handle[data-ae-handle='n'] {
  left: 50%;
  top: 0;
  cursor: ns-resize;
}
.ae-handle[data-ae-handle='ne'] {
  left: 100%;
  top: 0;
  cursor: nesw-resize;
}
.ae-handle[data-ae-handle='e'] {
  left: 100%;
  top: 50%;
  cursor: ew-resize;
}
.ae-handle[data-ae-handle='se'] {
  left: 100%;
  top: 100%;
  cursor: nwse-resize;
}
.ae-handle[data-ae-handle='s'] {
  left: 50%;
  top: 100%;
  cursor: ns-resize;
}
.ae-handle[data-ae-handle='sw'] {
  left: 0;
  top: 100%;
  cursor: nesw-resize;
}
.ae-handle[data-ae-handle='w'] {
  left: 0;
  top: 50%;
  cursor: ew-resize;
}
.ae-box.is-small
  .ae-handle:is(
    [data-ae-handle='n'],
    [data-ae-handle='s'],
    [data-ae-handle='e'],
    [data-ae-handle='w']
  ) {
  display: none;
}
.ae-centre {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed rgba(56, 90, 212, 0.3);
  pointer-events: none;
}
.ae-centre.is-snapped {
  border-left: 1.5px solid var(--ae-accent);
}
.ae-margin {
  position: absolute;
  border: 1px dashed rgba(14, 116, 144, 0.35);
  pointer-events: none;
}
.ae-margin.is-breached {
  border-color: rgba(160, 95, 0, 0.7);
}
.ae-crop {
  position: absolute;
  border: 1px dashed #5b6472;
  pointer-events: none;
}
.ae-crop span,
.ae-ghost span {
  position: absolute;
  left: 0;
  bottom: calc(100% + 3px);
  font-size: 10px;
  line-height: 1.3;
  color: #3d4450;
  white-space: nowrap;
  background: #ffffffd9;
  padding: 1px 5px;
  border-radius: 4px;
}
.ae-crop span {
  top: 4px;
  left: 4px;
  bottom: auto;
}
.ae-ghost {
  position: absolute;
  min-height: 0;
  padding: 0;
  border: 1px dashed #6b7280;
  background: rgba(107, 114, 128, 0.1);
  border-radius: 0;
  cursor: pointer;
}
.ae-ghost:hover {
  background: rgba(107, 114, 128, 0.18);
}
.ae-ghost.is-error {
  border-color: var(--ae-error);
  background: rgba(180, 35, 24, 0.14);
}
.ae-line {
  position: absolute;
  z-index: 2;
  touch-action: none;
  outline: none;
}
.ae-line.is-x {
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px solid var(--ae-measure);
  margin-left: -1px;
  cursor: ew-resize;
}
.ae-line.is-y {
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid var(--ae-measure);
  margin-top: -1px;
  cursor: ns-resize;
}
.ae-line::before {
  content: '';
  position: absolute;
}
.ae-line.is-x::before {
  inset: 0 -12px;
}
.ae-line.is-y::before {
  inset: -12px 0;
}
.ae-grip {
  position: absolute;
  background: var(--ae-measure);
  border: 2px solid #fff;
  border-radius: 9px;
  box-shadow: 0 1px 3px #1a1f2b40;
}
.ae-line.is-x .ae-grip {
  top: 10px;
  left: -10px;
  width: 18px;
  height: 30px;
}
.ae-line.is-y .ae-grip {
  left: 10px;
  top: -10px;
  width: 30px;
  height: 18px;
}
.ae-line:focus-visible .ae-grip {
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.4);
}
.ae-measure {
  position: absolute;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.ae-measure.is-x {
  top: 50%;
  height: 0;
  border-top: 1px dashed var(--ae-measure);
}
.ae-measure.is-y {
  left: 50%;
  width: 0;
  border-left: 1px dashed var(--ae-measure);
}
.ae-measure span {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--ae-measure);
  padding: 4px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.ae-readout {
  margin: 9px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ae-strip-head {
  margin: 14px 0 7px;
  font-size: 11px;
  font-weight: 600;
}
.ae-strip-head span {
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}
.ae-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}
.ae-thumb {
  flex: 0 0 auto;
  width: 78px;
  padding: 4px;
  min-height: 0;
  display: grid;
  gap: 4px;
  border-radius: 9px;
  text-align: left;
  position: relative;
}
.ae-thumb[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.ae-thumb-stage {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--ae-canvas);
}
.ae-thumb-box {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid var(--ae-accent);
  background: rgba(56, 90, 212, 0.2);
}
.ae-thumb .ae-missing {
  inset: 8%;
  font-size: 9px;
  text-align: center;
}
.ae-thumb-name {
  font-size: 10px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ae-thumb.is-warn .ae-thumb-box {
  border-color: var(--ae-warn);
  background: rgba(160, 95, 0, 0.22);
}
.ae-thumb.is-warn::after {
  content: '!';
  position: absolute;
  top: 1px;
  right: 1px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ae-warn);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.ae label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}
.ae-fields {
  display: grid;
  gap: 14px;
}
.ae-fields fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  min-width: 0;
}
.ae-fields legend {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 7px;
  padding: 0;
}
.ae-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding-right: 10px;
  min-width: 0;
}
.ae-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 130, 238, 0.2);
}
/* The generic input rule in styles.css is more specific than a class selector. */
.ae .ae-input input {
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  min-width: 0;
  width: 100% !important;
  padding: 9px 4px 9px 10px !important;
  font-size: 13px;
  color: var(--ink);
  background: transparent !important;
  font-variant-numeric: tabular-nums;
}
.ae .ae-input input:focus-visible {
  outline: 0;
}
.ae-input > span {
  font-size: 11px;
  color: var(--muted);
}
.ae-input:has(input[aria-invalid='true']) {
  border-color: var(--ae-error);
}
.ae-hint {
  grid-column: 1 / -1;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.ae-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ae-actions button {
  min-height: 34px;
  padding: 6px 13px;
  font-size: 12px;
}
.ae-actions .text-button {
  min-height: 0;
  padding: 0;
}
.ae-scale {
  padding: 12px 13px;
  border-radius: 10px;
  background: var(--work);
  font-size: 12px;
  line-height: 1.55;
  display: grid;
  gap: 10px;
}
.ae-scale.is-measured {
  background: #edf6f1;
}
.ae-scale strong {
  font-weight: 650;
}
.ae-issues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ae-issues li {
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 10px 8px 27px;
  border-radius: 8px;
  position: relative;
  background: var(--work);
  color: var(--ink);
}
.ae-issues li::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa3b2;
}
.ae-issues .is-ok {
  background: #edf6f1;
  color: #2f5a43;
}
.ae-issues .is-ok::before {
  background: #3f8a5f;
}
.ae-issues .is-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.ae-issues .is-warn::before {
  background: var(--ae-warn);
}
.ae-issues .is-error {
  background: #fdecea;
  color: var(--ae-error);
}
.ae-issues .is-error::before {
  background: var(--ae-error);
}
.ae-cal {
  display: grid;
  gap: 12px;
}
.ae-cal h4 {
  margin: 0;
  font-size: 15px;
}
.ae-cal ol {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.ae-cal-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ae .ae-consent {
  display: flex;
  margin: 0;
  font-size: 12px;
  color: var(--ink);
}
.ae-cal-result {
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f4f7;
  color: #0b5563;
}
.ae-cal-result.is-error {
  background: #fdecea;
  color: var(--ae-error);
}
/* The product form around the editor: checkboxes, price fields and the new-product dialog. */
.template-form > .row > .primary {
  font-size: 12px;
}
.template-form label.consent {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shared-place-fields fieldset > label {
  align-self: start;
}
.shared-place-fields .place-methods {
  gap: 8px 16px;
  align-content: start;
}
.template-form .place-methods .consent {
  margin: 0;
  line-height: 1.45;
}
#shared-product-message:not(:empty) {
  margin: 14px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdecea;
  color: #b42318;
  font-size: 12px;
  line-height: 1.5;
}
#shared-new-product {
  display: grid;
  gap: 16px;
}
.new-product-places {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px 12px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.new-product-places legend {
  font-size: 12px;
  font-weight: 600;
  padding: 0 6px;
}
.template-form .new-product-places .consent,
#shared-new-product > .consent {
  margin: 0;
}
@media (pointer: coarse) {
  .ae-keys {
    display: none;
  }
  .ae-handle {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
  }
  .ae-handle::before {
    inset: -10px;
  }
}
@media (max-width: 850px) {
  .ae {
    margin: 12px -4px 22px;
  }
  .ae-body {
    grid-template-columns: 1fr;
  }
  .ae-canvas {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
  }
  .ae-tabs {
    padding: 10px;
  }
  .ae-side {
    padding: 14px 12px;
  }
  .ae .ae-input input {
    font-size: 16px;
  }
  .ae-cal-fields {
    grid-template-columns: 1fr;
  }
  .shared-place-fields fieldset {
    grid-template-columns: 1fr;
  }
}
