/* ============ Kreator ============ */
.creator-page { background: var(--bg); min-height: 100vh; }
.creator { width: min(1560px, 100% - 24px); margin: 0 auto; padding: 26px 0 90px; }

.cr-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cr-products { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px; gap: 4px; box-shadow: var(--shadow-sm); }
.cr-products button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 10px 20px; border-radius: 999px; font: 700 .95rem var(--sans); color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; }
.cr-products { flex-wrap: wrap; border-radius: 22px; }
.cr-products button span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.cr-products button small { font: 700 .72rem var(--sans); color: var(--pink-2); margin-top: 2px; }
.cr-products button[aria-selected="true"] small { color: var(--gold); }
.cr-products button[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: 0 8px 20px -10px rgba(18,13,20,.6); }
.cr-products button[aria-selected="true"] svg { color: var(--gold); }
.cr-products button:not([aria-selected="true"]):hover { background: var(--cream); }
.cr-history { display: flex; align-items: center; gap: 6px; }
.save-state { font-size: .8rem; color: var(--muted); font-weight: 600; min-width: 80px; }

.tool-btn { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; font: 600 1rem var(--sans); display: inline-grid; place-items: center; transition: background .15s, border-color .15s; list-style: none; }
.tool-btn:hover:not(:disabled) { border-color: var(--ink); }
.tool-btn:disabled { opacity: .4; cursor: default; }
.tool-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tool-btn.danger:hover { background: #fdecec; border-color: #d64545; color: #c62828; }
.tool-btn::-webkit-details-marker { display: none; }

.cr-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr) 360px; gap: 14px; align-items: start; }

/* --- Narzędzia --- */
.cr-tools { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 76px 1fr; min-height: 560px; overflow: hidden; position: sticky; top: 92px; max-height: calc(100vh - 108px); }
.tool-tabs { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: var(--ink); }
.tool-tabs button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 2px; border: 0; background: none; border-radius: 14px; cursor: pointer; font: 700 .7rem var(--sans); color: #a99ca7; transition: background .15s, color .15s; }
.tool-tabs button i { font-style: normal; line-height: 0; color: #fff; }
.tool-tabs button[aria-selected="true"] { background: linear-gradient(135deg, var(--pink), var(--pink-2)); color: #fff; }
.tool-tabs button:hover { color: #fff; background: rgba(255,255,255,.07); }
/* min-height: 0 – bez tego element siatki rośnie do wysokości treści i lista zdjęć Izabeli nie przewija się */
.cr-tools { grid-template-rows: minmax(0, 1fr); }
.tool-panels { overflow-y: auto; padding: 18px 16px 24px; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tool-panel h3 { font: 700 1.2rem var(--serif); margin: 0 0 8px; }
.tool-panel .hint, .order-card .hint { font-size: .82rem; color: var(--muted); margin: 6px 0 12px; line-height: 1.5; }
.mt { margin-top: 20px !important; }
.mt-sm { margin-top: 8px; }

.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl { box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--tbg, #fff); cursor: pointer; font: 700 .76rem var(--sans); color: var(--ink); transition: border-color .15s, transform .15s; text-align: center; }
.tpl i { font-style: normal; font-size: 1.6rem; }
.tpl:hover { border-color: var(--pink); transform: translateY(-2px); }
.tpl-img { grid-column: span 2; padding: 6px; background: #fff; min-height: 0; }
.tpl-img img { width: 100%; border-radius: 9px; aspect-ratio: 2000 / 947; object-fit: cover; }
.tpl-img span { padding: 2px 0; }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 14px; border: 2px dashed #e0c9d7; border-radius: 16px; background: #fff8fc; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, body.dragging .dropzone { border-color: var(--pink); background: var(--pink-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dz-ico { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--pink-2)); color: #fff; display: grid; place-items: center; font-size: 1.2rem; }
.dropzone small { color: var(--muted); font-size: .78rem; }
.upload-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.up-item { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: #fff; }
.up-item img { width: 100%; height: 100%; object-fit: cover; }

.slogans { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: 600 .8rem var(--sans); cursor: pointer; color: var(--ink-2); text-align: left; }
.chip:hover { border-color: var(--pink); color: var(--pink-2); }
.text-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.text-style { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 6px; font-size: 1.15rem; cursor: pointer; line-height: 1.1; }
.text-style:hover { border-color: var(--pink); }

.sticker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stk { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(#fff, #f8f2ec); cursor: pointer; font: 700 .72rem var(--sans); color: var(--ink-2); }
.stk img { height: 110px; width: auto; object-fit: contain; }
.stk:hover { border-color: var(--pink); }
.emoji-grid, .shape-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.emo { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 0; }
.emo:hover { border-color: var(--pink); transform: scale(1.06); }
.shape-btn { color: var(--pink); font-size: 1.4rem; }

.swatch-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); background: var(--c); cursor: pointer; padding: 0; min-width: 30px; box-shadow: inset 0 0 0 2px #fff; }
.sw:hover { transform: scale(1.08); }
.sw.active { outline: 2.5px solid var(--pink); outline-offset: 2px; }
.color-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font: 700 .84rem var(--sans); }
.color-field input, .clr { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }

/* --- Edytor --- */
.cr-editor { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.props { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 8px; min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: relative; z-index: 5; }
.props-empty { color: var(--muted); font-size: .85rem; padding: 0 8px; }
.props-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.props-common { margin-left: auto; }
.props select, .props .num { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: 600 .86rem var(--sans); background: #fff; color: var(--ink); }
.sel-font { width: 190px; }
.props .num { width: 70px; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; font: 700 .82rem var(--sans); color: var(--ink-2); }
.inline-label input[type=range] { width: 90px; }
.quality { font: 800 .76rem var(--sans); padding: 8px 10px; border-radius: 999px; cursor: help; }
.q-good { background: #e3f6ea; color: #1c7a45; }
.q-ok { background: #fff3d6; color: #8a6400; }
.q-bad { background: #fde3e3; color: #b42323; }
.more { position: relative; }
.more summary { cursor: pointer; }
.more-pop { position: absolute; top: 46px; left: 0; width: 270px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); z-index: 20; }
.more-pop label { display: flex; flex-direction: column; gap: 6px; font: 700 .8rem var(--sans); margin-bottom: 12px; color: var(--ink-2); }
.more-pop textarea { border: 1px solid var(--line); border-radius: 10px; padding: 8px; font: 500 .9rem var(--sans); resize: vertical; }
.more-pop .inline { display: flex; align-items: center; gap: 8px; }
.more-pop .inline input[type=color] { width: 40px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.check-inline { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px; font: 600 .82rem var(--sans); color: var(--ink-2); cursor: pointer; }
.check-inline input { accent-color: var(--pink); width: 16px; height: 16px; }

.stage { position: relative; background: radial-gradient(rgba(18,13,20,.09) 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(180deg, #fff, #f4ede6); border-radius: 24px; border: 1px solid var(--line); padding: 22px; min-height: 360px; display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow-sm); }
.stage-inner { position: relative; box-shadow: 0 0 0 1px rgba(18,13,20,.06), 0 24px 60px -24px rgba(40, 20, 40, .5); background: var(--shirt, transparent); border-radius: 4px; }
body[data-product="tshirt"] .stage-inner { border-radius: 10px; }
body[data-product="tshirt"] .stage { background: radial-gradient(circle, #fff 0, #ede5dc 90%); }
.stage-inner .canvas-container { border-radius: inherit; }
.guides { position: absolute; inset: 0; pointer-events: none; }
.guides.off > * { display: none; }
.guides .g-v, .guides .g-h { position: absolute; background: #e63fa0; opacity: 0; transition: opacity .1s; }
.guides .g-v { left: 50%; top: 0; bottom: 0; width: 1px; }
.guides .g-h { top: 50%; left: 0; right: 0; height: 1px; }
.guides .on { opacity: .9; }
/* spad (rozjaśniony pas poza linią cięcia), linia cięcia, pole bezpieczne */
.guides { overflow: hidden; border-radius: inherit; }
.g-trim { position: absolute; inset: var(--ty, 0) var(--tx, 0); border: 1px solid rgba(18, 13, 20, .55); }
.guides.has-bleed .g-trim { box-shadow: 0 0 0 999px rgba(255, 255, 255, .42); }
.guides:not(.has-bleed) .g-trim { border: 1.5px dashed rgba(120, 120, 120, .55); }
.g-safe { position: absolute; inset: var(--sy, 0) var(--sx, 0); border: 1.5px dashed rgba(217, 83, 159, .7); border-radius: 2px; display: none; transition: border-color .15s, box-shadow .15s; }
.guides.has-safe .g-safe { display: block; }
.guides.edge .g-safe { border-color: #e0479e; box-shadow: inset 0 0 0 1px #e0479e; }
.g-label { position: absolute; bottom: 6px; white-space: nowrap; font: 800 .62rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: rgba(217, 83, 159, .75); background: rgba(255,255,255,.7); padding: 2px 6px; border-radius: 4px; display: none; }
.g-left { left: 25%; transform: translateX(-50%); }
.g-right { left: 75%; transform: translateX(-50%); }
.g-handle { position: absolute; top: 0; bottom: 0; width: 3%; background: repeating-linear-gradient(45deg, rgba(217, 83, 159, .12) 0 6px, transparent 6px 12px); display: none; }
.g-handle-l { left: 0; } .g-handle-r { right: 0; }
body[data-product="mug"] .g-label, body[data-product="mug"] .g-handle { display: block; }
body[data-product="mug"] .guides .g-v.on ~ .g-label { display: none; }
.stage-loading { position: absolute; inset: 0; display: none; place-items: center; background: rgba(244, 238, 231, .85); font-weight: 700; color: var(--ink-2); z-index: 3; border-radius: inherit; }
.stage-loading.show { display: grid; }
.stage-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); padding: 0 6px; }

/* --- Podgląd + zamówienie --- */
.cr-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 90px; }
.preview-card { background: radial-gradient(circle at 50% 38%, #fff 0, #f7e3ee 85%); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm); padding: 8px 14px 14px; }
.preview-card canvas { width: 100%; aspect-ratio: 1; touch-action: pan-y; }
body[data-product="mug"] .preview-card canvas { cursor: grab; }
.mug-controls { display: grid; gap: 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr) 44px; background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 8px 4px; border-radius: 999px; font: 700 .8rem var(--sans); cursor: pointer; color: var(--ink-2); }
.seg button.active { background: var(--ink); color: #fff; }
.order-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: var(--shadow-sm); }
.order-card h2 { font-size: 1.45rem; margin: 0 0 4px; }
.variant-list.compact { gap: 6px; }
.variant-list.compact .variant { padding: 9px 12px; font-size: .84rem; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.swatch-row .sw { width: 34px; height: 34px; }
.size-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.size { min-width: 46px; height: 40px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: 700 .85rem var(--sans); cursor: pointer; color: var(--ink); }
.size.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.qty-price { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 14px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; }
.qty button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; font-size: 1.1rem; cursor: pointer; }
.qty button:hover { background: var(--cream); }
.qty input { width: 40px; border: 0; text-align: center; font: 800 1rem var(--sans); -moz-appearance: textfield; appearance: textfield; background: none; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.price-big { font: 700 2.2rem/1 var(--serif); color: var(--pink-2); text-align: right; }
.price-big small { display: block; font: 600 .75rem var(--sans); color: var(--muted); margin-top: 4px; }
.warn { background: #fff4e0; border: 1px solid #f1d39b; color: #7a5200; font-size: .8rem; font-weight: 600; padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; line-height: 1.45; }
.perks { list-style: none; padding: 0; margin: 16px 0 0; font-size: .8rem; color: var(--muted); display: grid; gap: 4px; }

body.dragging .stage { outline: 3px dashed var(--pink); outline-offset: -8px; }

/* --- Profesjonalne dodatki --- */
.seg-2 { grid-template-columns: 1fr 1fr; margin: 4px 0 6px; }
.tool-panel .seg-2 { background: var(--cream); }
.dropzone-sm { padding: 16px 12px; }
.dropzone-sm .dz-ico { width: 40px; height: 40px; }
.attach-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.attach-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 28px; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: .82rem; font-weight: 600; }
.attach-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-list small { color: var(--muted); }
.attach-list button { border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 8px; height: 28px; }
.attach-list button:hover { background: #fdecec; color: #c62828; }

.layer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.layer { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 32px); gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: #fff; }
.layer.active { border-color: var(--pink); background: var(--pink-soft); }
.layer.hidden-l .l-main { opacity: .45; }
.l-main { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 6px; cursor: pointer; font: 600 .82rem var(--sans); color: var(--ink); min-width: 0; }
.l-main b { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--cream); display: grid; place-items: center; font-size: .8rem; }
.l-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-btn { height: 32px; border: 0; border-radius: 8px; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.l-btn:hover { background: var(--cream); color: var(--ink); }
.l-btn.on { background: var(--ink); color: #fff; }
.layer-empty { color: var(--muted); font-size: .85rem; }

.obj-size { font: 800 .76rem var(--sans); color: var(--ink-2); background: var(--cream); border-radius: 999px; padding: 8px 10px; white-space: nowrap; }
.ruler { position: absolute; font: 800 .62rem var(--sans); letter-spacing: .08em; color: var(--muted); pointer-events: none; white-space: nowrap; }
.ruler-x { left: 0; right: 0; top: -18px; text-align: center; border-bottom: 1px solid rgba(18,13,20,.18); line-height: 14px; }
.ruler-y { top: 50%; left: -14px; transform: translate(-50%, -50%) rotate(-90deg); }
.stage { padding: 30px 30px 22px; }

.preview-card { position: relative; }
.preview-label { position: absolute; top: 14px; left: 18px; font: 800 .68rem var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--pink-2); }

.order-card .tag { display: inline-block; background: var(--gold-soft); color: #8a6a12; font: 800 .7rem var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; margin-bottom: 10px; }
.order-card .opt { margin-top: 14px; }
.order-card .label-text small { font-weight: 600; color: var(--muted); }
.order-card .seg-2 { background: var(--cream); }
.notes { display: flex !important; flex-direction: column; gap: 6px; font: 700 .84rem var(--sans); color: var(--ink-2); }
.notes textarea { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 500 .88rem var(--sans); resize: vertical; background: #fff; }
.notes textarea:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
.dims { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--cream); font-size: .82rem; color: var(--ink-2); }
.dims:empty { display: none; }
.dims b { font: 700 1.05rem var(--serif); color: var(--ink); text-align: right; }
.dims small { grid-column: 1 / -1; color: var(--muted); }
.size-chart { margin: -6px 0 14px; overflow-x: auto; }
.size-chart table { width: 100%; border-collapse: collapse; font-size: .78rem; text-align: center; }
.size-chart th, .size-chart td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.size-chart thead th { font-weight: 800; color: var(--ink-2); }
.size-chart tbody th { text-align: left; font-weight: 700; color: var(--muted); }
.size-chart .on { background: var(--pink-soft); color: var(--pink-2); font-weight: 800; }
.size-chart small { display: block; margin-top: 6px; color: var(--muted); font-size: .74rem; }
.prod-info { margin-top: 18px; border-top: 1px solid var(--line); }
.prod-info details { border-bottom: 1px solid var(--line); }
.prod-info summary { cursor: pointer; list-style: none; padding: 14px 0; font: 700 .92rem var(--sans); display: flex; justify-content: space-between; align-items: center; }
.prod-info summary::-webkit-details-marker { display: none; }
.prod-info summary::after { content: "+"; font: 600 1.2rem var(--sans); color: var(--pink-2); }
.prod-info details[open] summary::after { content: "–"; }
.spec { margin: 0 0 14px; display: grid; gap: 8px; font-size: .82rem; }
.spec div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.spec dt { color: var(--muted); font-weight: 600; }
.spec dd { margin: 0; color: var(--ink-2); font-weight: 600; }
.prep { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 6px; font-size: .82rem; color: var(--ink-2); }

/* odzież i torba: kolor materiału pod projektem */
body[data-product="hoodie"] .stage-inner, body[data-product="bag"] .stage-inner { border-radius: 10px; }
body[data-product="hoodie"] .stage, body[data-product="bag"] .stage { background: radial-gradient(circle, #fff 0, #ede5dc 90%); }

/* legenda linii, skróty */
.guide-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 6px; font-size: .76rem; color: var(--muted); font-weight: 600; }
.guide-legend span { display: inline-flex; align-items: center; gap: 7px; }
.guide-legend span::before { content: ""; width: 18px; height: 10px; border-radius: 2px; }
.lg-bleed::before { background: repeating-linear-gradient(45deg, rgba(18,13,20,.18) 0 3px, rgba(255,255,255,.8) 3px 6px); border: 1px solid var(--line); }
.lg-trim::before { border: 1.5px solid rgba(18,13,20,.6); }
.lg-safe::before { border: 1.5px dashed #e0479e; }
.shortcuts { margin: 2px 6px 0; font-size: .74rem; color: var(--muted); line-height: 1.9; }
.shortcuts kbd { font: 700 .7rem var(--sans); padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #fff; color: var(--ink-2); }
#printInfo b { color: var(--ink-2); }

/* kontrola przed drukiem */
.preflight-box { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: #fff; }
.pf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pf-head b { font: 700 .95rem var(--serif); }
.pf-state { font: 800 .7rem var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }
.pf-state.ok { background: #e3f6ea; color: #1c7a45; }
.pf-state.warn { background: #fff3d6; color: #8a6400; }
.pf-state.bad { background: #fde3e3; color: #b42323; }
.preflight { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .8rem; line-height: 1.45; color: var(--ink-2); }
.preflight li { position: relative; padding-left: 26px; }
.preflight li::before { position: absolute; left: 0; top: -1px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 800 .7rem var(--sans); color: #fff; }
.pf-ok::before { content: "✓"; background: #2e9d5b; }
.pf-warn::before { content: "!"; background: #d99a00; }
.pf-bad::before { content: "✕"; background: #d64545; }
.pf-info::before { content: "i"; background: var(--ink); font-style: italic; }
.pf-info { color: var(--muted); }
body.exporting { cursor: progress; }
body.exporting .stage-loading { display: grid; }

/* --- Responsywność --- */
@media (max-width: 1280px) {
  .cr-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .cr-side { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .preview-card canvas { max-width: 420px; margin: 0 auto; }
}
@media (max-width: 860px) {
  .creator { width: calc(100% - 16px); padding-top: 10px; }
  .cr-layout { grid-template-columns: 1fr; }
  .cr-editor { order: 1; }
  .cr-tools { order: 2; position: static; max-height: none; min-height: 0; grid-template-columns: 1fr; }
  .tool-tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; }
  .tool-tabs button { flex: 1 0 64px; }
  .tool-panels { max-height: 380px; }
  .cr-side { order: 3; grid-template-columns: 1fr; }
  .cr-products button { padding: 9px 14px; }
  .sel-font { width: 150px; }
  .props-common { margin-left: 0; }
  .stage { padding: 8px; min-height: 240px; }
  .tpl-grid { grid-template-columns: repeat(3, 1fr); }
  .tpl-img { grid-column: span 3; }
  .sticker-grid { grid-template-columns: repeat(3, 1fr); }
  .stk img { height: 86px; }
  .emoji-grid, .shape-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 480px) {
  .cr-products button span { display: none; }
  .cr-products button { font-size: 1.15rem; padding: 8px 16px; }
  .save-state { display: none; }
}

/* mobile: pasek ikon poziomo, ciemny */
@media (max-width: 860px) {
  .tool-tabs { flex-direction: row; border-radius: 24px 24px 0 0; }
  .tool-tabs button i svg { width: 20px; height: 20px; }
}
@media (max-width: 480px) {
  .cr-products button span { display: none; }
  .cr-products button { padding: 9px 16px; }
}
.tpl-dark { color: #fff; }
@media (max-width: 860px) {
  .stage { padding: 12px; }
  .ruler { display: none; }
  .page-hero .steps { display: none; }
  .spec div { grid-template-columns: 96px 1fr; }
}

/* nowe narzędzia: wyrównanie, obrót, korekta zdjęć */
.more-pop.pop-right { left: auto; right: 0; }
.pop-label { display: block; font: 700 .8rem var(--sans); color: var(--ink-2); margin-bottom: 8px; }
.align-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.align-grid .tool-btn { width: 100%; }
.more-pop output { min-width: 38px; text-align: right; font: 700 .78rem var(--sans); color: var(--muted); }
.more-pop .inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.more-pop .inline input[type=range] { flex: 1; min-width: 100px; }
.more-pop .btn-sm { padding: 8px 12px; font-size: .8rem; }
#pGrad { height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font: 600 .84rem var(--sans); background: #fff; }
.clr:disabled { opacity: .35; cursor: not-allowed; }
.emoji-grid { grid-template-columns: repeat(6, 1fr); }
.shape-grid { grid-template-columns: repeat(4, 1fr); }
.shape-btn { font-size: 1.25rem; }
.sticker-grid .stk img { height: 120px; }
.text-styles { grid-template-columns: 1fr 1fr; }
.text-style { font-size: 1.05rem; }

/* ---- Telefony ---- */
@media (pointer: coarse) { .shortcuts { display: none; } }
@media (max-width: 760px) {
  .creator-page .page-hero { padding-top: 96px; padding-bottom: 28px; }
  .creator-page .page-hero p { display: none; }
  .creator-page .page-hero h1 { font-size: 2rem; }
  .cr-tools input[type="checkbox"], .cr-tools input[type="radio"], .cr-editor input[type="checkbox"] { width: 22px; height: 22px; }
  .tool-panels { max-height: 62vh; }
}
