/* PersonArt — Impression sur rouleau · studio */
.pap {
  --teal: #0ba3a2;
  --teal-d: #087f7e;
  --teal-s: #e7f7f6;
  --coral: #fc634d;
  --coral-d: #e24c37;
  --coral-s: #fff0ec;
  --ink: #1f2424;
  --ink2: #3c4545;
  --muted: #6b7675;
  --line: #e1e8e7;
  --line2: #eef3f2;
  --bg: #f4f7f7;
  --panel: #ffffff;
  --ok: #0f8f62;
  --mid: #b7791f;
  --low: #d64531;
  --r: 12px;
  --shadow: 0 10px 30px rgba(24, 45, 44, .12);
  --ease: cubic-bezier(.2, .75, .25, 1);
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: grid;
  grid-template-rows: 64px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.admin-bar .pap { top: 32px; }
@media (max-width: 782px) { .admin-bar .pap { top: 46px; } }
html.pap-lock, html.pap-lock body { overflow: hidden !important; }
body.pap-studio-page .ht-ctc, body.pap-studio-page .ht_ctc_chat_greetings_box, body.pap-studio-page #wpfront-notification-bar, body.pap-studio-page #wpfront-notification-bar-spacer { display: none !important; }
.pap *, .pap *::before, .pap *::after { box-sizing: border-box; }
.pap button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; margin: 0; letter-spacing: normal; text-transform: none; line-height: inherit; border-radius: 0; min-height: 0; box-shadow: none; }
.pap button:disabled { cursor: not-allowed; }
.pap input { font: inherit; color: inherit; margin: 0; }
.pap h2, .pap h3, .pap h4, .pap h5, .pap p, .pap ul, .pap ol, .pap dl, .pap dd { margin: 0; padding: 0; }
.pap ul, .pap ol { list-style: none; }
.pap svg { width: 18px; height: 18px; flex: none; }
.pap img { max-width: none; }
.pap [hidden] { display: none !important; }
.pap :focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.pap kbd { display: inline-block; padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: #fff; font: 600 11px/1.3 Montserrat, Arial, sans-serif; }

/* ---------------- top bar ---------------- */
.pap-top { display: flex; align-items: center; gap: 14px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); min-width: 0; }
.pap-logo img { display: block; height: 34px; width: auto; }
.pap-top__title { display: flex; flex-direction: column; min-width: 0; padding-left: 14px; border-left: 1px solid var(--line); }
.pap-top__title strong { font-size: 14px; font-weight: 700; white-space: nowrap; }
.pap-top__title span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pap-top__tools { display: flex; gap: 4px; margin-left: auto; }
.pap-iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px !important; color: var(--ink2); transition: background .15s, color .15s; }
.pap-iconbtn:hover:not(:disabled) { background: var(--line2); color: var(--ink); }
.pap-iconbtn:disabled { opacity: .35; }
.pap-iconbtn--sm { width: 32px; height: 32px; }
.pap-top__total { display: flex; flex-direction: column; align-items: flex-end; padding: 0 6px 0 14px; border-left: 1px solid var(--line); }
.pap-top__total small { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pap-top__total b { font-size: 18px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pap-cta { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px !important; border-radius: 10px !important; background: var(--coral) !important; color: #fff !important; font-weight: 700 !important; font-size: 13px !important; box-shadow: 0 8px 20px rgba(252, 99, 77, .28) !important; transition: transform .15s var(--ease), background .15s, opacity .15s; white-space: nowrap; }
.pap-cta:hover:not(:disabled) { background: var(--coral-d) !important; transform: translateY(-1px); }
.pap-cta:disabled { opacity: .45; box-shadow: none !important; }
.pap.is-busy .pap-cta span::after { content: "…"; }

/* ---------------- layout ---------------- */
.pap-body { display: grid; grid-template-columns: 384px minmax(0, 1fr); min-height: 0; }
.pap-side { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.pap-tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px; gap: 4px; border-bottom: 1px solid var(--line); }
.pap-tabs button, .pap-mobnav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px !important; border-radius: 10px !important; color: var(--muted); font-size: 11.5px; font-weight: 600; transition: background .15s, color .15s; }
.pap-tabs button:hover { background: var(--line2); color: var(--ink); }
.pap-tabs button.is-active, .pap-mobnav button.is-active { background: var(--teal-s); color: var(--teal-d); }
.pap-tabs i, .pap-mobnav i { position: absolute; top: 4px; right: 16px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--coral); color: #fff; font: 700 10px/18px Montserrat, Arial, sans-serif; font-style: normal; }
.pap-panels { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.pap-panel { padding: 18px 18px 28px; display: flex; flex-direction: column; gap: 14px; animation: pap-in .25s var(--ease); }
@keyframes pap-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pap-sheet-handle { display: none; }
.pap-mobnav { display: none; }

.pap-ph { display: flex; gap: 12px; align-items: flex-start; }
.pap-ph__step { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; }
.pap-ph h3 { font-size: 17px; font-weight: 800; line-height: 1.25; }
.pap-ph p { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.pap-sub { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.pap h5 { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.pap-note { font-size: 12px; color: var(--muted); }
.pap-warn { padding: 10px 12px; border-radius: 10px; background: #fff6e8; color: #8a5a12; font-size: 12.5px; }
.pap-panel__foot { margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* buttons */
.pap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px !important; border-radius: 10px !important; font-weight: 700 !important; font-size: 13.5px !important; text-decoration: none !important; transition: transform .15s var(--ease), background .15s, box-shadow .15s, opacity .15s; }
.pap-btn--primary { background: var(--ink) !important; color: #fff !important; }
.pap-btn--primary:hover:not(:disabled) { background: #000 !important; transform: translateY(-1px); }
.pap-btn--cta { background: var(--coral) !important; color: #fff !important; box-shadow: 0 10px 24px rgba(252, 99, 77, .28) !important; }
.pap-btn--cta:hover:not(:disabled) { background: var(--coral-d) !important; transform: translateY(-1px); }
.pap-btn--ghost { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }
.pap-btn--ghost:hover:not(:disabled) { border-color: var(--ink2) !important; }
.pap-btn--sm { height: 34px; padding: 0 12px !important; font-size: 12px !important; }
.pap-btn--block { width: 100%; }
.pap-btn:disabled { opacity: .4; }
.pap-link { color: var(--teal-d) !important; font-weight: 700 !important; font-size: 12.5px !important; text-decoration: underline !important; text-underline-offset: 3px; align-self: center; }
.pap-link--danger { color: var(--low) !important; }
.pap-link:disabled { opacity: .4; }

/* materials */
.pap-mats { display: flex; flex-direction: column; gap: 10px; }
.pap-mat { display: grid !important; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px !important; text-align: left; border: 1.5px solid var(--line) !important; border-radius: 14px !important; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.pap-mat:hover { border-color: #bfd8d6 !important; transform: translateY(-1px); }
.pap-mat.is-on { border-color: var(--teal) !important; box-shadow: 0 0 0 3px var(--teal-s); }
.pap-mat__swatch { width: 64px; height: 64px; border-radius: 10px; background: var(--line2) center/cover; }
.pap-mat__body { display: flex; flex-direction: column; min-width: 0; }
.pap-mat__body b { font-size: 14px; font-weight: 700; }
.pap-mat__body small { font-size: 11.5px; color: var(--teal-d); font-weight: 600; }
.pap-mat__body em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.pap-mat__price { display: flex; flex-direction: column; align-items: flex-end; }
.pap-mat__price b { font-size: 18px; font-weight: 800; }
.pap-mat__price small { font-size: 10px; color: var(--muted); font-weight: 600; }
.pap-widths { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pap-width { position: relative; display: flex !important; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 10px 9px !important; border: 1.5px solid var(--line) !important; border-radius: 12px !important; background: #fff; text-align: left; transition: border-color .15s, box-shadow .15s; }
.pap-width b { font-size: 15px; font-weight: 800; }
.pap-width small { font-size: 10.5px; color: var(--muted); }
.pap-width span { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink2); }
.pap-width span i { font-style: normal; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.pap-width em { position: absolute; top: -9px; left: 8px; padding: 0 7px; border-radius: 9px; background: var(--teal); color: #fff; font: 700 9.5px/16px Montserrat, Arial, sans-serif; font-style: normal; white-space: nowrap; }
.pap-width.is-on { border-color: var(--teal) !important; box-shadow: 0 0 0 3px var(--teal-s); }
.pap-width.is-na { opacity: .5; }
.pap-na { color: var(--low) !important; }
.pap-tip { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; padding: 12px; border-radius: 12px; background: var(--teal-s); color: var(--teal-d); font-size: 12.5px; }
.pap-tip .pap-link { grid-column: 2; justify-self: start; }

/* images panel */
.pap-dropzone { display: flex !important; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px !important; border: 1.5px dashed #b9d4d2 !important; border-radius: 14px !important; background: #fbfefe; color: var(--teal-d); transition: background .15s, border-color .15s; }
.pap-dropzone:hover { background: var(--teal-s); border-color: var(--teal) !important; }
.pap-dropzone svg { width: 24px; height: 24px; }
.pap-dropzone b { font-size: 14px; color: var(--ink); }
.pap-dropzone small { font-size: 11.5px; color: var(--muted); }
.pap-files { display: flex; flex-direction: column; gap: 6px; }
.pap-file { display: flex; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.pap-file.is-on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-s); }
.pap-file__main { flex: 1; display: flex !important; gap: 10px; align-items: center; min-width: 0; text-align: left; }
.pap-file__thumb { position: relative; flex: none; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--line2); }
.pap-file__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pap-file__thumb i { position: absolute; left: 3px; top: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: rgba(31, 36, 36, .78); color: #fff; font: 700 9.5px/16px Montserrat, Arial, sans-serif; font-style: normal; text-align: center; }
.pap-file__meta { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.pap-file__meta b { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pap-file__meta small { font-size: 11px; color: var(--muted); }
.pap-file__bar { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--line2); overflow: hidden; width: 140px; }
.pap-file__bar span { display: block; height: 100%; background: var(--teal); transition: width .2s; }
.pap-q { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; }
.pap-q svg { width: 13px; height: 13px; }
.pap-q.is-ok { color: var(--ok); }
.pap-q.is-mid { color: var(--mid); }
.pap-q.is-low { color: var(--low); }

.pap-edit { display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: 16px; background: #fff; border: 1.5px solid var(--teal); box-shadow: 0 0 0 4px var(--teal-s); animation: pap-in .2s var(--ease); }
.pap-edit__head { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.pap-edit__head b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pap-edit__thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--line2); }
.pap-edit__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pap-size { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.pap-size label { display: flex; flex-direction: column; gap: 4px; position: relative; }
.pap-size label span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pap-size input { width: 100%; height: 44px; padding: 0 34px 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pap-size input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-s); }
.pap-size i { position: absolute; right: 12px; bottom: 13px; font-style: normal; font-size: 12px; color: var(--muted); }
.pap-lock { display: grid !important; place-items: center; width: 36px; height: 44px; border-radius: 10px !important; color: var(--muted); border: 1.5px solid var(--line) !important; }
.pap-lock.is-on { color: var(--teal-d); background: var(--teal-s); border-color: transparent !important; }
.pap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pap-chip { padding: 6px 10px !important; border-radius: 999px !important; border: 1px solid var(--line) !important; background: #fff; font-size: 11.5px; color: var(--ink2); transition: border-color .15s, background .15s; }
.pap-chip b { font-weight: 800; color: var(--ink); }
.pap-chip:hover { border-color: var(--teal) !important; background: var(--teal-s); }
.pap-crop { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--line2); }
.pap-crop label { display: grid; grid-template-columns: 84px 1fr; align-items: center; font-size: 12px; color: var(--ink2); }
.pap input[type=range] { width: 100%; accent-color: var(--teal); }
.pap-row2 { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; justify-content: space-between; }
.pap-row2 > div { min-width: 0; }
.pap-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--line2); gap: 2px; }
.pap-seg button { padding: 6px 12px !important; border-radius: 8px !important; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.pap-seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.pap-seg--sm button { padding: 5px 8px !important; font-size: 11.5px; }
.pap-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pap-stepper button { display: grid !important; place-items: center; width: 34px; height: 34px; color: var(--ink2); }
.pap-stepper button:hover:not(:disabled) { background: var(--line2); }
.pap-stepper button:disabled { opacity: .3; }
.pap-stepper output { min-width: 30px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.pap-pos { font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* layout panel */
.pap-toggle { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pap-toggle b { display: block; font-size: 13.5px; }
.pap-toggle small { font-size: 11.5px; color: var(--muted); }
.pap-switch { position: relative; width: 44px; height: 26px; border-radius: 13px !important; background: #cdd6d5 !important; transition: background .2s; }
.pap-switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.pap-switch[aria-checked="true"] { background: var(--teal) !important; }
.pap-switch[aria-checked="true"] span { transform: translateX(18px); }
.pap-range { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pap-range > span { display: flex; justify-content: space-between; font-size: 13.5px; }
.pap-range output { font-weight: 800; color: var(--teal-d); }
.pap-align { display: flex; gap: 6px; flex-wrap: wrap; }
.pap-meter { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--line2); }
.pap-meter p { font-size: 12px; color: var(--ink2); }
.pap-meter__bar { height: 8px; border-radius: 4px; background: #dfe7e6; overflow: hidden; }
.pap-meter__bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--teal), #4ccfc3); transition: width .3s var(--ease); }

/* summary */
.pap-recap { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pap-recap dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.pap-recap dd { text-align: right; font-weight: 700; font-size: 13px; }
.pap-recap dd small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.pap-qty { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.pap-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; border-top: 2px solid var(--ink); }
.pap-total span { font-weight: 700; }
.pap-total b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pap-probs { display: flex; flex-direction: column; gap: 6px; }
.pap-probs li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--low); }
.pap-probs svg { width: 16px; height: 16px; margin-top: 1px; }

/* ---------------- stage ---------------- */
.pap-stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pap-stage__bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .7); backdrop-filter: blur(6px); }
.pap-stage__info { flex: 1; display: flex; gap: 14px; align-items: center; justify-content: center; font-size: 12.5px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.pap-stage__info b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.pap-usage { display: inline-flex; align-items: center; gap: 6px; }
.pap-usage::before { content: ""; width: 40px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--teal) var(--u), #dbe4e3 var(--u)); }
.pap-zoom { margin-left: auto; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.pap-zoom button { width: 34px; height: 32px; font-size: 18px; font-weight: 500; color: var(--ink2); }
.pap-zoom button:hover { background: var(--line2); }
.pap-zoom .pap-zoom__val { width: auto; padding: 0 8px !important; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pap-stage__scroll { position: relative; flex: 1; overflow: auto; overscroll-behavior: contain; background-color: var(--bg); background-image: radial-gradient(rgba(31, 36, 36, .07) 1px, transparent 1px); background-size: 18px 18px; touch-action: pan-x pan-y; }
.pap-stage__canvas { position: relative; margin: 0 auto; padding: 56px 32px 80px 32px; }
.pap-ruler { position: absolute; pointer-events: none; }
.pap-ruler canvas { display: block; }
.pap-ruler--x { top: 4px; left: 32px; }
.pap-ruler--y { top: 56px; left: 6px; }
.pap-roll { position: relative; }
.pap-roll__core { position: absolute; left: -10px; right: -10px; top: -24px; height: 28px; border-radius: 14px; background: linear-gradient(180deg, #f9fbfb 0%, #e9eeee 35%, #c9d3d2 70%, #aebbba 100%); box-shadow: 0 8px 14px rgba(24, 45, 44, .18), inset 0 1px 0 #fff; z-index: 2; }
.pap-roll__core::before, .pap-roll__core::after { content: ""; position: absolute; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle, #6b7675 0 3px, #c4cfce 4px 6px, #eef2f2 7px); }
.pap-roll__core::before { left: -6px; }
.pap-roll__core::after { right: -6px; }
.pap-roll__sheet { position: relative; background-color: #fff; box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(24, 45, 44, .12); overflow: hidden; }
.pap[data-view="edit"] .pap-roll__sheet { background-image: linear-gradient(rgba(11, 163, 162, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 163, 162, .07) 1px, transparent 1px); background-size: var(--grid) var(--grid); }
.pap-roll__margin { position: absolute; top: 0; bottom: 0; z-index: 1; background: repeating-linear-gradient(-45deg, rgba(31, 36, 36, .05) 0 4px, transparent 4px 8px); pointer-events: none; }
.pap-roll__margin--l { left: 0; border-right: 1px dashed rgba(31, 36, 36, .18); }
.pap-roll__margin--r { right: 0; border-left: 1px dashed rgba(31, 36, 36, .18); }
.pap-roll__items { position: absolute; inset: 0; z-index: 2; }
.pap-roll__tex { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .3s; mix-blend-mode: multiply; }
.pap[data-view="preview"] .pap-roll__tex { opacity: 1; }
.pap-roll__sheet[data-tex="canvas"] .pap-roll__tex, .pap-roll__sheet[data-tex="weave"] .pap-roll__tex {
  background-image: repeating-linear-gradient(0deg, rgba(70, 60, 50, .05) 0 1px, transparent 1px 2px), repeating-linear-gradient(90deg, rgba(70, 60, 50, .045) 0 1px, transparent 1px 2px), linear-gradient(180deg, rgba(250, 244, 232, .25), rgba(250, 244, 232, .25));
}
.pap-roll__sheet[data-tex="weave"] .pap-roll__tex { background-image: repeating-linear-gradient(0deg, rgba(70, 60, 50, .07) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(70, 60, 50, .06) 0 1px, transparent 1px 3px); }
.pap-roll__sheet[data-tex="grain"] .pap-roll__tex { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .32 0 0 0 0 .3 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.pap-roll__sheet[data-tex="paper"] .pap-roll__tex { background-image: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .25) 48%, rgba(255, 255, 255, 0) 62%); mix-blend-mode: screen; }
.pap-roll__end { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; pointer-events: none; border-top: 2px dashed var(--coral); background: repeating-linear-gradient(-45deg, rgba(244, 247, 247, .92) 0 6px, rgba(234, 239, 239, .92) 6px 12px); }
.pap-roll__end span { position: absolute; right: 8px; top: 6px; padding: 3px 8px; border-radius: 6px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pap-roll__sheet.is-empty .pap-roll__end { display: none; }

.pap-it { position: absolute; background: #fff; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; box-shadow: 0 0 0 1px rgba(31, 36, 36, .12), 0 6px 14px rgba(24, 45, 44, .10); transition: box-shadow .15s; }
.pap-it:active { cursor: grabbing; }
.pap-it__print { position: absolute; overflow: hidden; background: var(--line2); }
.pap-it__img { position: absolute; overflow: hidden; transform-origin: center; }
.pap-it__img img { position: absolute; display: block; pointer-events: none; }
.pap-it__progress { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .7); overflow: hidden; display: none; }
.pap-it__progress span { display: block; height: 100%; background: var(--teal); transition: width .2s; }
.pap-it.is-uploading .pap-it__progress { display: block; }
.pap-it.is-uploading .pap-it__print { opacity: .6; }
.pap-it__badge { position: absolute; left: 4px; top: 4px; padding: 1px 6px; border-radius: 6px; font: 700 10px/16px Montserrat, Arial, sans-serif; color: #fff; background: rgba(31, 36, 36, .72); pointer-events: none; }
.pap-it__badge:empty { display: none; }
.pap-it__badge.is-low { background: var(--low); }
.pap-it__badge.is-mid { background: var(--mid); }
.pap-it__rot { position: absolute; right: 4px; top: 4px; display: none; padding: 1px 6px; border-radius: 6px; background: rgba(11, 163, 162, .9); color: #fff; font: 700 10px/16px Montserrat, Arial, sans-serif; pointer-events: none; }
.pap-it.is-rotated .pap-it__rot { display: block; }
.pap[data-view="preview"] .pap-it__rot { display: none; }
.pap-it__dims { position: absolute; right: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .9); font: 700 10px/16px Montserrat, Arial, sans-serif; color: var(--ink); pointer-events: none; opacity: 0; transition: opacity .15s; font-variant-numeric: tabular-nums; }
.pap-it:hover .pap-it__dims, .pap-it.is-selected .pap-it__dims { opacity: 1; }
.pap-it__handle { position: absolute; right: -7px; bottom: -7px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--teal); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); cursor: nwse-resize; display: none; touch-action: none; }
.pap-it.is-selected { box-shadow: 0 0 0 2px var(--teal), 0 10px 24px rgba(11, 163, 162, .25); z-index: 2; }
.pap-it.is-selected .pap-it__handle { display: block; }
.pap-it.is-overlap { box-shadow: 0 0 0 2px var(--coral), 0 0 0 6px rgba(252, 99, 77, .2); }
.pap-it.is-overlap::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(252, 99, 77, .16) 0 6px, transparent 6px 12px); pointer-events: none; }
.pap-it.is-error { box-shadow: 0 0 0 2px var(--low); }
.pap[data-view="preview"] .pap-it { cursor: default; box-shadow: none; }
.pap[data-view="preview"] .pap-it__handle, .pap[data-view="preview"] .pap-it__badge, .pap[data-view="preview"] .pap-it__dims, .pap[data-view="preview"] .pap-roll__margin { display: none; }
.pap-guides { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.pap-guide { position: absolute; background: var(--coral); }
.pap-guide--v { top: 0; bottom: 0; width: 1px; }
.pap-guide--h { left: 0; right: 0; height: 1px; }

.pap-empty { position: absolute; inset: 52px 0 0 0; display: grid; place-items: center; padding: 20px; pointer-events: none; z-index: 6; }
.pap-empty__card { pointer-events: auto; max-width: 420px; padding: 30px 28px; border-radius: 22px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pap-empty__card h2 { font-size: 20px; font-weight: 800; }
.pap-empty__card p { font-size: 13px; color: var(--muted); }
.pap-empty__art { position: relative; width: 120px; height: 74px; margin-bottom: 6px; }
.pap-empty__art span { position: absolute; border-radius: 6px; box-shadow: 0 6px 14px rgba(24, 45, 44, .18); }
.pap-empty__art span:nth-child(1) { left: 6px; top: 12px; width: 46px; height: 58px; background: linear-gradient(160deg, #ffcfb8, var(--coral)); transform: rotate(-8deg); }
.pap-empty__art span:nth-child(2) { left: 40px; top: 2px; width: 50px; height: 66px; background: linear-gradient(160deg, #bfece8, var(--teal)); }
.pap-empty__art span:nth-child(3) { left: 78px; top: 16px; width: 38px; height: 50px; background: linear-gradient(160deg, #f6e7c5, #d9a54a); transform: rotate(7deg); }
.pap-drop { position: absolute; inset: 8px; z-index: 30; display: none; place-items: center; border: 3px dashed var(--teal); border-radius: 18px; background: rgba(231, 247, 246, .85); pointer-events: none; }
.pap-drop span { padding: 12px 20px; border-radius: 12px; background: #fff; color: var(--teal-d); font-weight: 800; box-shadow: var(--shadow); }
.pap.is-dropping .pap-drop { display: grid; }

.pap-seltools { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 14px 30px rgba(0, 0, 0, .25); animation: pap-in .2s var(--ease); }
.pap-seltools__label { padding: 0 10px; font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pap-seltools button { display: grid !important; place-items: center; width: 38px; height: 38px; border-radius: 10px !important; color: #fff !important; }
.pap-seltools button:hover { background: rgba(255, 255, 255, .14); }
.pap-seltools button.is-danger:hover { background: var(--low); }

/* toasts + modal */
.pap-toasts { position: fixed; top: 76px; right: 16px; z-index: 100000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.pap-toast { display: flex; align-items: flex-start; gap: 10px; max-width: 360px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 12.5px; box-shadow: 0 12px 30px rgba(0, 0, 0, .22); animation: pap-in .25s var(--ease); transition: opacity .3s, transform .3s; }
.pap-toast svg { width: 16px; height: 16px; margin-top: 1px; }
.pap-toast.is-ok svg { color: #6ee7c8; }
.pap-toast.is-warn svg { color: #ffc26b; }
.pap-toast.is-error { background: #7a1d12; }
.pap-toast.is-out { opacity: 0; transform: translateX(10px); }
.pap-modal { position: fixed; inset: 0; z-index: 100001; display: grid; place-items: center; padding: 20px; background: rgba(20, 28, 28, .5); backdrop-filter: blur(3px); animation: pap-fade .2s; }
@keyframes pap-fade { from { opacity: 0; } }
.pap-modal__card { position: relative; width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border-radius: 20px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: 12px; animation: pap-in .25s var(--ease); }
.pap-modal__card h2 { font-size: 21px; font-weight: 800; line-height: 1.25; }
.pap-modal__card p { color: var(--ink2); font-size: 13.5px; }
.pap-modal__x { position: absolute; top: 14px; right: 14px; display: grid !important; place-items: center; width: 34px; height: 34px; border-radius: 10px !important; color: var(--muted); }
.pap-modal__x:hover { background: var(--line2); }
.pap-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.pap-steps { counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.pap-steps li { counter-increment: s; position: relative; padding-left: 40px; font-size: 13px; color: var(--ink2); }
.pap-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--teal-s); color: var(--teal-d); font-weight: 800; }
.pap-steps b { color: var(--ink); }
.is-success { text-align: center; align-items: center; }
.pap-success__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--teal-s); color: var(--teal-d); }
.pap-success__icon svg { width: 32px; height: 32px; }
.is-success .pap-modal__actions { justify-content: center; }
.pap-noscript { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .pap-body { grid-template-columns: 340px minmax(0, 1fr); }
  .pap-top__tools [data-act="help"] { display: none; }
}
@media (max-width: 900px) {
  .pap { grid-template-rows: 56px 1fr; }
  .pap-top { gap: 8px; padding: 0 8px; }
  .pap-logo img { height: 28px; }
  .pap-top__title { display: none; }
  .pap-top__tools { margin-left: auto; }
  .pap-top__tools .pap-iconbtn { width: 34px; height: 34px; }
  .pap-top__total { padding: 0 4px 0 8px; }
  .pap-top__total b { font-size: 15px; }
  .pap-top__total small { font-size: 9px; }
  .pap-cta { width: 42px; padding: 0 !important; justify-content: center; }
  .pap-cta span { display: none; }
  .pap-body { grid-template-columns: 1fr; padding-bottom: 64px; }
  .pap-side { position: fixed; left: 0; right: 0; bottom: 64px; z-index: 40; height: min(64vh, 560px); border-right: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -18px 40px rgba(24, 45, 44, .18); transform: translateY(calc(100% + 64px)); transition: transform .3s var(--ease); }
  .pap.is-sheet-open .pap-side { transform: none; }
  .pap-tabs { display: none; }
  .pap-sheet-handle { display: flex; justify-content: center; padding: 8px 0 2px; cursor: pointer; }
  .pap-sheet-handle span { width: 42px; height: 5px; border-radius: 3px; background: #cfd8d7; }
  .pap-panel { padding: 8px 16px 24px; }
  .pap-mobnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; height: 64px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
  .pap-mobnav button { font-size: 11px; }
  .pap-stage__bar { padding: 8px 10px; gap: 8px; }
  .pap-stage__info { justify-content: flex-start; gap: 10px; font-size: 11.5px; }
  .pap-stage__info span:not(.pap-usage) { display: none; }
  .pap-seg button { padding: 6px 9px !important; font-size: 11.5px; }
  .pap-stage__canvas { padding: 52px 16px 120px 28px; }
  .pap-ruler--x { left: 28px; }
  .pap-ruler--y { left: 2px; }
  .pap-seltools { bottom: 14px; }
  .pap-toasts { top: auto; bottom: 140px; left: 12px; right: 12px; align-items: center; }
  .pap-empty { inset: 46px 0 0 0; }
  .pap-empty__card { padding: 24px 20px; }
  .pap-size input { font-size: 16px; }
}
@media (max-width: 420px) {
  .pap-zoom button { width: 30px; }
  .pap-seg button { padding: 6px 7px !important; }
  .pap-stage__info { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pap *, .pap *::before, .pap *::after { animation: none !important; transition: none !important; }
}
