.pc {
  --pc-accent: #1a1a1a;
  --pc-border: rgba(127, 127, 127, 0.35);
  margin: 1.25rem 0;
  font: inherit;
  color: inherit;
}
.pc[hidden] { display: none; }
.pc__heading { margin: 0 0 0.75rem; font-size: 1.1em; }

.pc__preview {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--pc-border);
}
.pc__preview-img { display: block; width: 100%; height: auto; }
.pc__tint {
  position: absolute; inset: 0;
  mix-blend-mode: multiply;
  opacity: 0; transition: opacity 0.2s, background-color 0.2s;
  pointer-events: none;
}
.pc__tint.is-active { opacity: 0.55; }
.pc__overlay {
  position: absolute;
  left: var(--pc-text-x); top: var(--pc-text-y);
  transform: translate(-50%, -50%);
  max-width: 90%;
  color: var(--pc-text-color, #fff);
  font-size: var(--pc-text-size, 32px);
  line-height: 1.1; text-align: center;
  white-space: pre-wrap; overflow-wrap: anywhere;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.pc__overlay--serif { font-family: Georgia, 'Times New Roman', serif; }
.pc__overlay--sans { font-family: 'Helvetica Neue', Arial, sans-serif; }
.pc__overlay--script { font-family: 'Brush Script MT', 'Segoe Script', cursive; }
.pc__overlay--mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

.pc__fields { display: grid; gap: 1rem; }
.pc__field { position: relative; }
.pc__label { display: block; margin-bottom: 0.4rem; font-weight: 600; padding: 0; }
.pc__current { font-weight: 400; opacity: 0.75; }
.pc__input {
  width: 100%; box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  font: inherit; color: inherit; background: transparent;
  border: 1px solid var(--pc-border); border-radius: 6px;
}
.pc__input:focus { outline: 2px solid var(--pc-accent); outline-offset: 1px; }
.pc__count { position: absolute; right: 0; top: 0; font-size: 0.85em; opacity: 0.65; }

.pc__swatches { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pc__swatches legend { width: 100%; }
.pc__swatch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pc__swatch {
  width: 2.25rem; height: 2.25rem; padding: 3px; box-sizing: border-box;
  border: 1px solid var(--pc-border); border-radius: 50%;
  cursor: pointer;
}
.pc__swatch-color { display: block; width: 100%; height: 100%; border-radius: 50%; background: #ddd; }
.pc__swatch-input:checked + .pc__swatch { border: 2px solid var(--pc-accent); padding: 2px; }
.pc__swatch-input:focus-visible + .pc__swatch { outline: 2px solid var(--pc-accent); outline-offset: 2px; }

.pc__check-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.pc__checkbox { width: 1.1rem; height: 1.1rem; accent-color: var(--pc-accent); }

.pc__error { margin: 0.75rem 0 0; color: #c0392b; font-weight: 600; }
.pc__visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- v2: all option types ---- */
.pc__set { display: grid; gap: 1rem; }
.pc__set + .pc__set { margin-top: 1rem; }
.pc__set-title { margin: 0; font-size: 1em; }
.pc__field[hidden] { display: none; }
.pc__field--inline { display: grid; grid-template-columns: minmax(8rem, 35%) 1fr; align-items: center; gap: 0.75rem; }
.pc__field--inline .pc__help, .pc__field--inline .pc__ferr { grid-column: 2; }
.pc__req { color: #c0392b; }
.pc__hint, .pc__muted { font-weight: 400; opacity: 0.7; }
.pc__help { margin: 0.35rem 0 0; font-size: 0.9em; opacity: 0.75; }
.pc__ferr { margin: 0.35rem 0 0; color: #c0392b; font-size: 0.9em; }
.pc__ferr[hidden] { display: none; }
.pc__tip { display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; margin-left: 0.35em; border-radius: 50%; border: 1px solid currentColor; font-size: 0.75em; font-style: italic; cursor: help; position: relative; vertical-align: middle; }
.pc__tip:hover::after, .pc__tip:focus::after { content: attr(data-tip); position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 16rem; padding: 0.4rem 0.6rem; background: #222; color: #fff; border-radius: 4px; font-style: normal; font-weight: 400; font-size: 0.85rem; z-index: 5; white-space: normal; }
.pc__vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }
.pc__group { border: 0; margin: 0; padding: 0; min-width: 0; }
.pc__values { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pc__choice { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.pc__field--radio .pc__values, .pc__field--checkbox .pc__values { flex-direction: column; gap: 0.35rem; }
.pc__choice-input { width: 1.05rem; height: 1.05rem; accent-color: var(--pc-accent); margin: 0; }
.pc__check { cursor: pointer; }
.pc__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: 0.4rem 0.9rem; border: 1px solid var(--pc-border); border-radius: 6px; cursor: pointer; background: transparent; color: inherit; font: inherit; }
.pc__btn--primary { background: var(--pc-accent); color: #fff; border-color: var(--pc-accent); }
.pc__choice-input:checked + .pc__btn { border: 2px solid var(--pc-accent); padding: calc(0.4rem - 1px) calc(0.9rem - 1px); font-weight: 600; }
.pc__choice-input:focus-visible + .pc__btn, .pc__choice-input:focus-visible + .pc__swatch { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.pc__swatch { width: 2.25rem; height: 2.25rem; padding: 3px; box-sizing: border-box; border: 1px solid var(--pc-border); border-radius: 50%; cursor: pointer; display: inline-block; }
.pc__swatch--large { width: 3.5rem; height: 3.5rem; }
.pc__swatch--square, .pc__swatch--square .pc__swatch-fill { border-radius: 6px; }
.pc__swatch-fill { display: block; width: 100%; height: 100%; border-radius: 50%; background: #ddd center / cover no-repeat; }
.pc__choice-input:checked + .pc__swatch { border: 2px solid var(--pc-accent); padding: 2px; }
.pc__switch { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 600; }
.pc__switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pc__switch-ui { width: 2.4rem; height: 1.4rem; border-radius: 1rem; background: var(--pc-border); position: relative; transition: background 0.2s; flex: none; }
.pc__switch-ui::after { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pc__switch-input:checked + .pc__switch-ui { background: var(--pc-accent); }
.pc__switch-input:checked + .pc__switch-ui::after { transform: translateX(1rem); }
.pc__switch-input:focus-visible + .pc__switch-ui { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.pc__rangewrap { display: flex; align-items: center; gap: 0.75rem; }
.pc__slider { flex: 1; accent-color: var(--pc-accent); }
.pc__out { min-width: 3rem; text-align: right; font-variant-numeric: tabular-nums; }
.pc__range2 { display: flex; gap: 0.5rem; align-items: center; }
.pc__field--color .pc__input { padding: 0.2rem; height: 2.6rem; width: 4rem; }
.pc__dd { position: relative; }
.pc__dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; cursor: pointer; text-align: left; }
.pc__dd-face { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pc__dd-list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 0.25rem; list-style: none; background: var(--pc-bg, #fff); color: #222; border: 1px solid var(--pc-border); border-radius: 6px; max-height: 18rem; overflow: auto; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.pc__dd-list[hidden] { display: none; }
.pc__dd-opt { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; border-radius: 4px; cursor: pointer; }
.pc__dd-opt:hover, .pc__dd-opt:focus { background: rgba(127,127,127,.15); outline: none; }
.pc__dd-opt[aria-selected="true"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--pc-accent); }
.pc__dd-img { width: 2rem; height: 2rem; object-fit: cover; border-radius: 4px; }
.pc__dd-color { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1px solid var(--pc-border); flex: none; }
.pc__heading2 { margin: 0.25rem 0 0; }
.pc__para { margin: 0; white-space: pre-line; }
.pc__hr { border: 0; border-top: 1px solid var(--pc-border); margin: 0.25rem 0; }
.pc__link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.pc__dialog { border: 0; border-radius: 10px; padding: 1rem 1.25rem 1.25rem; max-width: min(40rem, calc(100vw - 32px)); width: 100%; box-sizing: border-box; }
.pc__dialog::backdrop { background: rgba(0,0,0,.45); }
.pc__dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; gap: 1rem; }
.pc__html img { max-width: 100%; height: auto; }
.pc__html table { border-collapse: collapse; width: 100%; }
.pc__html td, .pc__html th { border: 1px solid var(--pc-border); padding: 0.35rem 0.5rem; }
.pc__x { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 0.25rem; }
.pc__details { border: 1px solid var(--pc-border); border-radius: 8px; padding: 0.5rem 0.9rem; }
.pc__summary { cursor: pointer; font-weight: 600; padding: 0.25rem 0; }
.pc__group-body { display: grid; gap: 1rem; padding: 0.6rem 0 0.4rem; }
.pc__file { display: block; max-width: 100%; }
.pc__files { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.4rem; }
.pc__file-item { display: flex; align-items: center; gap: 0.6rem; overflow-wrap: anywhere; }
.pc__file-thumb { width: 3rem; height: 3rem; object-fit: cover; border-radius: 4px; }
.pc__crop-frame { position: relative; overflow: hidden; width: 100%; background: #111; touch-action: none; cursor: grab; border-radius: 6px; }
.pc__crop-img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; transform-origin: 0 0; }
.pc__crop input[type=range] { width: 100%; margin: 0.75rem 0; accent-color: var(--pc-accent); }
.pc__crop-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.pc__tiers { margin: 0; padding-left: 1.1rem; font-size: 0.9em; opacity: 0.85; }
.pc__summary-box { margin-top: 1rem; padding: 0.75rem 0.9rem; border: 1px solid var(--pc-border); border-radius: 8px; display: grid; gap: 0.3rem; font-size: 0.95em; }
.pc__summary-box[hidden] { display: none; }
.pc__sum-title { font-weight: 600; }
.pc__sum-row { display: flex; justify-content: space-between; gap: 1rem; }
.pc__sum-total { border-top: 1px solid var(--pc-border); padding-top: 0.35rem; margin-top: 0.2rem; font-weight: 600; }

/* ---- image cards (photo + name, like Ymq) ---- */
.pc__card-wrap { position: relative; min-width: 0; }
.pc__card { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; border: 1px solid var(--pc-border); border-radius: 6px; background: var(--pc-card-bg, #fff); cursor: pointer; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.pc__card:hover { border-color: rgba(127, 127, 127, 0.7); }
.pc__card-img { display: block; width: 100%; aspect-ratio: 1 / 1; background: #eee center / cover no-repeat; }
.pc__card-text { display: block; padding: 0.4rem 0.35rem 0.5rem; font-size: 0.8em; line-height: 1.3; text-align: center; color: inherit; opacity: 0.85; overflow-wrap: anywhere; }
.pc__choice-input:checked + .pc__card { border: 2px solid var(--pc-selected, #3fae4c); box-shadow: 0 0 0 1px var(--pc-selected, #3fae4c) inset; }
.pc__choice-input:checked + .pc__card .pc__card-text { opacity: 1; }
.pc__choice-input:checked + .pc__card::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--pc-selected, #3fae4c); border: 2px solid #fff; }
.pc__choice-input:focus-visible + .pc__card { outline: 2px solid var(--pc-selected, #3fae4c); outline-offset: 2px; }
.pc__card-zoom { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 3px; background: rgba(60, 60, 60, 0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.2'/%3E%3Cpath d='M10.2 10.2 13.5 13.5'/%3E%3C/svg%3E") center / 12px no-repeat; cursor: zoom-in; opacity: 0.85; }
.pc__card-zoom:hover, .pc__card-zoom:focus-visible { opacity: 1; }
.pc__zoom { max-width: min(46rem, calc(100vw - 32px)); }
.pc__zoom-img { display: block; width: 100%; height: auto; border-radius: 6px; }
.pc__current { font-weight: 400; opacity: 0.65; }
@media (max-width: 420px) { .pc__card-text { font-size: 0.72em; } }

/* settings toggles */
.pc--no-current .pc__current { display: none; }
.pc--no-required .pc__req { display: none; }
.pc--one-column .pc__field--radio .pc__values, .pc--one-column .pc__field--checkbox .pc__values { display: flex; flex-direction: column; }
[data-val][hidden] { display: none !important; }

/* ---- v3: Ymq-style layout options ---- */
.pc__set { display: flex; flex-wrap: wrap; gap: 1rem; }
.pc__set > * { flex: 1 1 100%; min-width: 0; }
.pc__set > .pc__field--w, .pc__group-body > .pc__field--w { flex: 0 0 calc(var(--pc-w, 100) * 1% - 1rem * (100 - var(--pc-w, 100)) / 100); }
@media (max-width: 640px) { .pc__set > .pc__field--w, .pc__group-body > .pc__field--w { flex-basis: calc(var(--pc-mw, 100) * 1% - 1rem * (100 - var(--pc-mw, 100)) / 100); } }
.pc__group-body { display: flex; flex-wrap: wrap; gap: 1rem; }
.pc__group-body > * { flex: 1 1 100%; min-width: 0; }
.pc__field--nolabel > .pc__label, .pc__field--nolabel .pc__group > legend.pc__label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pc__field--novaltext .pc__card-text { display: none; }
.pc__values--grid { display: grid; grid-template-columns: repeat(var(--pc-cols, 3), minmax(0, 1fr)); }
@media (max-width: 640px) { .pc__values--grid { grid-template-columns: repeat(var(--pc-mcols, var(--pc-cols, 3)), minmax(0, 1fr)); } }
.pc__values--x { display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 0.25rem; }
.pc__values--x > * { flex: 0 0 auto; scroll-snap-align: start; }
.pc__values--x .pc__card-wrap { width: var(--pc-img, 8rem); }
.pc__card-img { height: var(--pc-img, auto); border-radius: var(--pc-rad, 0); }
.pc__field[style*="--pc-img"] .pc__card-img { aspect-ratio: auto; }
.pc__field[style*="--pc-img"] .pc__swatch { width: var(--pc-img); height: var(--pc-img); }
.pc__field[style*="--pc-rad"] .pc__swatch, .pc__field[style*="--pc-rad"] .pc__swatch-fill { border-radius: var(--pc-rad); }
.pc__choice-input:disabled + label, .pc__choice-input:disabled + .pc__card { opacity: 0.45; cursor: not-allowed; }
.pc__vprice { opacity: 0.85; }
.pc__vwas { opacity: 0.6; margin-left: 0.15em; }
.pc__vlink { margin-left: 0.3em; text-decoration: none; font-size: 0.9em; }
.pc__ptrig { display: inline-flex; align-items: center; gap: 0.3em; margin-left: 0.5em; padding: 0; border: 0; background: none; font: inherit; font-weight: 400; text-decoration: underline; cursor: pointer; color: inherit; vertical-align: middle; }
.pc__ptrig img { display: block; width: auto; }
