:root {
	--pk-green: #0e4d3c;
	--pk-green-2: #13664f;
	--pk-bg: #f2f1ee;
	--pk-card: #fff;
	--pk-text: #1d1d1b;
	--pk-muted: #7a7a74;
	--pk-line: #e3e1dc;
	--pk-radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Jost, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--pk-bg); color: var(--pk-text); -webkit-font-smoothing: antialiased; }
button { font: inherit; }
[hidden] { display: none !important; }

/* ---------- Галерея интерьеров ---------- */
.pk-gallery { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; }
.pk-top { display: flex; align-items: center; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.pk-logo img { height: 28px; display: block; }
.pk-top h1 { font-size: 26px; font-weight: 500; margin: 0; letter-spacing: -.01em; }
.pk-rooms { columns: 4 240px; column-gap: 14px; }
.pk-room { display: block; break-inside: avoid; margin: 0 0 14px; border-radius: var(--pk-radius); overflow: hidden; cursor: pointer; background: #ddd; position: relative; border: 0; padding: 0; width: 100%; }
.pk-room img { display: block; width: 100%; height: auto; transition: transform .35s ease; }
.pk-room:hover img { transform: scale(1.04); }
.pk-room span.pk-room-name { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.92); border-radius: 20px; padding: 3px 11px; font-size: 13px; }
.pk-upload { background: var(--pk-green); color: #fff; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 8px; }
.pk-upload:hover { background: var(--pk-green-2); }
.pk-upload-ico { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.15); display: grid; place-items: center; margin-bottom: 6px; }
.pk-upload-ico svg { width: 32px; height: 32px; }
.pk-upload b { font-weight: 500; font-size: 17px; }
.pk-upload small { opacity: .75; font-size: 13px; }
.pk-note { color: var(--pk-muted); font-size: 13px; text-align: center; margin-top: 10px; }

/* ---------- Редактор ---------- */
.pk-editor { display: flex; height: 100vh; height: 100dvh; }
.pk-stage { flex: 1; position: relative; display: flex; flex-direction: column; min-width: 0; background: #e9e8e4; }
.pk-toolbar { display: flex; gap: 8px; padding: 14px 16px; align-items: center; }
.pk-spacer { flex: 1; }
.pk-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: #fff; border-radius: 22px; padding: 8px 14px; cursor: pointer; font-size: 14px; color: var(--pk-text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.pk-btn svg { width: 18px; height: 18px; }
.pk-btn:hover { background: #f7f7f5; }
.pk-btn.is-on { background: var(--pk-green); color: #fff; }
.pk-canvas-wrap { position: relative; margin: auto; flex: none; }
.pk-canvas-wrap canvas { display: block; width: 100%; height: 100%; border-radius: 6px; }
.pk-before { position: absolute; inset: 0; overflow: hidden; }
.pk-before canvas { width: 100%; height: 100%; }
.pk-divider { position: absolute; top: 0; bottom: 0; width: 0; cursor: ew-resize; touch-action: none; }
.pk-divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.35); }
.pk-divider span { position: absolute; top: 50%; left: -20px; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.pk-divider span::before { content: "‹ ›"; display: block; text-align: center; line-height: 38px; font-size: 18px; color: var(--pk-green); letter-spacing: 2px; }
.pk-pins { position: absolute; inset: 0; pointer-events: none; }
.pk-pin { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; width: 38px; height: 38px; border-radius: 50%; border: 2px solid #fff; background: var(--pk-green); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.3); transition: transform .15s; }
.pk-pin:hover { transform: translate(-50%, -50%) scale(1.1); }
.pk-pin svg { width: 18px; height: 18px; }
.pk-pin.is-off { background: rgba(255,255,255,.92); color: var(--pk-green); }
.pk-bottom { display: flex; align-items: center; gap: 20px; padding: 12px 18px 16px; flex-wrap: wrap; }
.pk-range { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pk-range input { width: 180px; accent-color: var(--pk-green); }
.pk-brushbar .pk-range input { width: 120px; }
.pk-hint { color: var(--pk-muted); font-size: 13px; }
.pk-busy { position: absolute; inset: 0; background: rgba(242,241,238,.82); display: grid; place-items: center; z-index: 5; backdrop-filter: blur(2px); }
.pk-busy-box { background: #fff; border-radius: var(--pk-radius); padding: 26px 30px; width: min(360px, 90%); text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.pk-busy-box b { font-weight: 500; }
.pk-busy-box small { color: var(--pk-muted); }
.pk-bar { width: 100%; height: 6px; background: var(--pk-line); border-radius: 3px; overflow: hidden; }
.pk-bar i { display: block; height: 100%; width: 0; background: var(--pk-green); transition: width .2s; }
.pk-spinner { width: 34px; height: 34px; border: 3px solid var(--pk-line); border-top-color: var(--pk-green); border-radius: 50%; animation: pkspin 0.9s linear infinite; }
@keyframes pkspin { to { transform: rotate(360deg); } }

/* ---------- Панель каталога ---------- */
.pk-panel { width: 380px; flex: none; background: var(--pk-card); display: flex; flex-direction: column; border-left: 1px solid var(--pk-line); min-height: 0; }
.pk-current { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--pk-line); align-items: center; }
.pk-current img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.pk-cur-name { font-size: 14px; line-height: 1.3; }
.pk-cur-price { font-weight: 600; margin: 4px 0; }
.pk-cur-link { color: var(--pk-green); font-size: 14px; text-decoration: none; font-weight: 500; }
.pk-search { margin: 14px 16px 6px; position: relative; }
.pk-search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--pk-muted); }
.pk-search input { width: 100%; border: 1px solid var(--pk-line); border-radius: 22px; padding: 10px 14px 10px 38px; font: inherit; font-size: 14px; outline: none; background: var(--pk-bg); }
.pk-search input:focus { border-color: var(--pk-green); background: #fff; }
.pk-filters { padding: 4px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.pk-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pk-chips::-webkit-scrollbar { display: none; }
.pk-chip { flex: none; border: 1px solid var(--pk-line); background: #fff; border-radius: 16px; padding: 5px 11px; font-size: 13px; cursor: pointer; color: var(--pk-text); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pk-chip:hover { border-color: #b9cfc8; }
.pk-chip.is-on { background: var(--pk-green); border-color: var(--pk-green); color: #fff; }
.pk-chip i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.pk-count { padding: 8px 16px 0; font-size: 12px; color: var(--pk-muted); }
.pk-catalog { flex: 1; overflow-y: auto; padding: 8px 16px 20px; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: 12px; align-content: start; }
.pk-item { border: 2px solid transparent; border-radius: 12px; background: var(--pk-bg); cursor: pointer; padding: 0; text-align: left; overflow: hidden; display: flex; flex-direction: column; }
.pk-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #e6e5e1; }
.pk-item span { font-size: 12px; padding: 7px 9px 2px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pk-item em { font-style: normal; font-weight: 600; font-size: 13px; padding: 2px 9px 9px; }
.pk-item.is-active { border-color: var(--pk-green); }
.pk-item:hover { border-color: #b9cfc8; }
.pk-item.is-active:hover { border-color: var(--pk-green); }
.pk-empty { grid-column: 1 / -1; color: var(--pk-muted); text-align: center; padding: 20px 0; font-size: 14px; }
.pk-more { grid-column: 1 / -1; height: 1px; }

/* ---------- Ваши фото ---------- */
.pk-mine { margin-bottom: 18px; }
.pk-mine h2 { font-size: 16px; font-weight: 500; margin: 0 0 10px; }
.pk-mine-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.pk-mine-item { position: relative; flex: none; }
.pk-mine-item img { height: 110px; width: auto; border-radius: 10px; display: block; cursor: pointer; }
.pk-mine-item button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; line-height: 22px; font-size: 16px; padding: 0; }

/* ---------- Стены, кисть ---------- */
.pk-overlay { position: absolute; inset: 0; pointer-events: none; }
.pk-pin.is-sel { box-shadow: 0 0 0 4px rgba(40,190,140,.55), 0 2px 10px rgba(0,0,0,.3); transform: translate(-50%, -50%) scale(1.12); }
.pk-pin img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pk-wallbar b { font-weight: 500; font-size: 14px; }
.pk-canvas-wrap.is-brush { touch-action: none; cursor: none; }
.pk-cursor { position: absolute; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; background: rgba(30,200,150,.15); }
.pk-cursor.is-erase { background: rgba(230,80,80,.15); }
.pk-seg { display: inline-flex; background: #fff; border-radius: 22px; padding: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.pk-seg button { border: 0; background: none; border-radius: 18px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--pk-text); }
.pk-seg button.is-on { background: var(--pk-green); color: #fff; }
.pk-btn:disabled { opacity: .45; cursor: default; }

/* ---------- Калькулятор и корзина ---------- */
.pk-current { flex-direction: column; align-items: stretch; }
.pk-cur-row { display: flex; gap: 12px; align-items: center; }
.pk-calc { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pk-calc-fields { display: flex; gap: 8px; }
.pk-calc-fields label { flex: 1; font-size: 12px; color: var(--pk-muted); display: flex; flex-direction: column; gap: 3px; }
.pk-calc-fields input { border: 1px solid var(--pk-line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 14px; color: var(--pk-text); width: 100%; }
.pk-calc-fields input:focus { outline: none; border-color: var(--pk-green); }
.pk-calc-res { font-size: 13px; color: var(--pk-muted); }
.pk-calc-res b { color: var(--pk-text); font-weight: 600; }
.pk-calc-actions { display: flex; gap: 8px; }
.pk-qty { display: flex; border: 1px solid var(--pk-line); border-radius: 22px; overflow: hidden; }
.pk-qty button { border: 0; background: none; width: 32px; cursor: pointer; font-size: 16px; }
.pk-qty input { width: 44px; border: 0; text-align: center; font: inherit; -moz-appearance: textfield; }
.pk-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pk-cart { flex: 1; border: 0; border-radius: 22px; background: var(--pk-green); color: #fff; font: inherit; font-weight: 500; padding: 10px; cursor: pointer; }
.pk-cart:hover { background: var(--pk-green-2); }
.pk-cart:disabled { opacity: .5; cursor: default; }
.pk-cart-msg { font-size: 13px; color: var(--pk-green); }
.pk-cart-msg a { color: var(--pk-green); font-weight: 600; }
.pk-cart-msg.is-error { color: #b3261e; }
.pk-coll { margin-top: 10px; border: 1px dashed #b9cfc8; background: #f5faf8; color: var(--pk-green); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.pk-also { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--pk-muted); }
.pk-also button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--pk-line); background: #fff; border-radius: 16px; padding: 3px 10px 3px 3px; cursor: pointer; font-size: 12px; }
.pk-also img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ---------- Мобильные ---------- */
@media (max-width: 860px) {
	.pk-top h1 { font-size: 20px; }
	.pk-rooms { columns: 2 140px; column-gap: 10px; }
	.pk-room { margin-bottom: 10px; }
	.pk-upload { min-height: 170px; padding: 14px; }
	.pk-upload b { font-size: 15px; }
	.pk-editor { flex-direction: column; height: auto; min-height: 100vh; }
	.pk-stage { flex: none; }
	.pk-toolbar { padding: 10px; }
	.pk-btn span { display: none; }
	.pk-btn { padding: 8px 12px; }
	.pk-bottom { padding: 10px 12px 12px; gap: 8px; }
	.pk-range input { width: 130px; }
	.pk-panel { width: 100%; border-left: 0; border-top: 1px solid var(--pk-line); }
	.pk-catalog { grid-template-columns: repeat(3, 1fr); overflow: visible; gap: 8px; padding: 8px 12px 20px; }
	.pk-current { padding: 12px; }
	.pk-pin { width: 32px; height: 32px; }
	.pk-wallbar .pk-hint { display: none; }
	.pk-mine-item img { height: 90px; }
}

/* Размеры стены вместо ручного масштаба: рисунок в реальном размере по ширине рулона */
.pk-wallsize { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.pk-wallsize-title { font-weight: 600; }
.pk-wallsize label { display: flex; align-items: center; gap: 6px; color: #6b7472; }
.pk-wallsize input { width: 64px; height: 34px; padding: 0 8px; border: 1px solid #dfe3e2; border-radius: 8px; font-size: 14px; }
.pk-wallsize-x { color: #9aa3a1; }
@media (max-width: 600px) { .pk-wallsize input { width: 56px; } }
.pk-canvas-wrap.is-wait { cursor: progress; }
