/* PNP_PISACZEK_ZRZUT_EDYTOR_V8 (V11: Galeria) — edytor zrzutu ekranu (czarno-złoty jak program) */
:root { --bg: #0a0a0c; --panel: #16130d; --panel2: #221d13; --line: #3a3020; --gold: #d4af37; --gold2: #f3d98b; --deep: #926c1e; --ivory: #f7f0de; --muted: #c8bca0; --green: #60d68e; --red: #e5484d; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ivory); font: 15px/1.35 "Segoe UI", system-ui, sans-serif; overflow: hidden; user-select: none; }
body { display: grid; grid-template-columns: 92px 1fr; grid-template-rows: auto 1fr auto auto; grid-template-areas: "top top" "tools stage" "rec rec" "bot bot"; }
button { font: inherit; color: var(--ivory); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--deep); background: #3a2f1b; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--gold); color: #0a0a0c; border-color: var(--gold); font-weight: 600; }
button.primary:hover { background: var(--gold2); }
button.danger { background: #5a1d1f; border-color: #8a2d30; }
button.ic { width: 38px; padding: 6px 0; font-size: 18px; }
#top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 56px; }
.brand { white-space: nowrap; color: var(--gold2); }
.brand b { color: var(--ivory); font-weight: 600; }
#dim { color: var(--muted); font-size: 13px; margin-left: 6px; }
#opts { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; min-width: 0; }
#opts .lab { color: var(--muted); font-size: 13px; margin-left: 6px; }
#opts .sw { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid #555; }
#opts .sw.on { border-color: var(--gold2); box-shadow: 0 0 0 2px #0a0a0c, 0 0 0 4px var(--gold); }
#opts .wd { padding: 4px 10px; display: flex; align-items: center; justify-content: center; min-width: 44px; height: 32px; }
#opts .wd.on, #opts .opt.on { border-color: var(--gold); background: #3a2f1b; color: var(--gold2); }
#opts .wd i { display: block; background: var(--ivory); border-radius: 4px; width: 22px; }
.right { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
#zval { min-width: 52px; text-align: center; color: var(--muted); font-size: 13px; }
#tools { grid-area: tools; display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
#tools button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 6px; font-size: 12px; line-height: 1.15; background: transparent; border-color: transparent; color: var(--muted); }
#tools button svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#tools button:hover { color: var(--ivory); }
#tools button.on { background: #3a2f1b; border-color: var(--gold); color: var(--gold2); }
#stage { grid-area: stage; position: relative; overflow: auto; background: #1a1a1d repeating-conic-gradient(#1d1d21 0 25%, #18181b 0 50%) 0 0 / 24px 24px; }
#wrap { position: relative; margin: 20px auto; width: max-content; box-shadow: 0 6px 30px rgba(0,0,0,.6); }
#cv { display: block; image-rendering: auto; touch-action: none; }
#txt { position: absolute; z-index: 5; background: rgba(255,255,255,.08); border: 1px dashed var(--gold); outline: none; resize: none; overflow: hidden; padding: 0 2px; font-weight: 700; font-family: "Segoe UI", system-ui, sans-serif; line-height: 1.2; min-width: 60px; }
#hint { position: sticky; left: 0; bottom: 10px; margin: 0 auto 10px; width: max-content; max-width: 90%; padding: 6px 14px; border-radius: 18px; background: rgba(10,10,12,.88); border: 1px solid var(--line); color: var(--muted); font-size: 13px; pointer-events: none; }
#bot { grid-area: bot; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border-top: 1px solid var(--line); }
#bot button { padding: 9px 18px; }
#status { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#status.ok { color: var(--green); }
#status.err { color: var(--red); }
.grow { flex: 1; }
#dlg, #nohost, .modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 20; }
#dlg[hidden], #nohost[hidden], .modal[hidden] { display: none; }
.box { background: var(--panel); border: 1px solid var(--deep); border-radius: 12px; padding: 22px 26px; max-width: 460px; box-shadow: 0 10px 40px rgba(0,0,0,.7); }
.box p { margin: 0 0 18px; font-size: 16px; }
.box .row { display: flex; gap: 10px; justify-content: flex-end; }
#opts input[type=range] { width: 200px; accent-color: var(--gold); cursor: pointer; }
#opts .val { min-width: 30px; color: var(--gold2); font-variant-numeric: tabular-nums; }
#opts .opt.primary { background: var(--gold); color: #0a0a0c; border-color: var(--gold); font-weight: 600; }
/* V3: Ostatnie zrzuty, Tekst z obrazu, ustawienia */
#recentBtn.on { border-color: var(--gold); background: #3a2f1b; color: var(--gold2); }
#recent { grid-area: rec; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 14px 10px; }
#recent[hidden] { display: none; }
#recent .rh { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
#recList { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; min-height: 40px; align-items: stretch; }
#recList .empty { color: var(--muted); padding: 10px 0; }
.rc { position: relative; flex: 0 0 150px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.rc:hover { border-color: var(--deep); }
.rc.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); cursor: default; }
.rc img { width: 100%; height: 78px; object-fit: contain; background: #111; border-radius: 4px; }
.rc .nm { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc .tm { font-size: 11px; color: var(--muted); }
.rc .tm.un { color: var(--gold2); }
.rc .x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; padding: 0; font-size: 12px; border-radius: 50%; background: rgba(10,10,12,.85); opacity: 0; }
.rc:hover .x { opacity: 1; }
.box.wide { width: min(720px, 92vw); max-width: none; }
#ocrTxt { width: 100%; height: 280px; background: #0f0e0b; color: var(--ivory); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 15px/1.45 "Segoe UI", system-ui, sans-serif; resize: vertical; user-select: text; }
#ocrMsg { min-height: 22px; margin: 8px 0 14px; color: var(--muted); font-size: 13px; }
#ocrMsg.ok { color: var(--green); } #ocrMsg.err { color: var(--red); }
#prefs { position: fixed; top: 60px; right: 14px; z-index: 15; width: 360px; background: var(--panel); border: 1px solid var(--deep); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.7); }
#prefs[hidden] { display: none; }
#prefs .ph { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#prefs .lab { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
#prefs label { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
#prefs input { accent-color: var(--gold); margin-top: 3px; }
#prefs .note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
/* V3: 10 narzędzi — ciaśniejsza kolumna, żeby mieściła się z otwartym paskiem Ostatnich */
#tools { gap: 2px; padding: 8px 6px; }
#tools button { padding: 6px 2px 5px; gap: 2px; }
#tools button svg { width: 22px; height: 22px; }
.rc img { height: 64px; }
/* V4: ramka z uchwytami — Poszerz / zwęź */
#wrap { margin: 28px auto 14px; }
#handles { position: absolute; inset: 0; pointer-events: none; outline: 1px dashed rgba(212,175,55,.55); outline-offset: 0; }
#handles[hidden] { display: none; }
#handles .hd { position: absolute; width: 12px; height: 12px; background: #0a0a0c; border: 2px solid var(--gold); border-radius: 3px; pointer-events: auto; z-index: 4; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
#handles .hd:hover { background: var(--gold); }
/* uchwyty całe na zewnątrz obrazu — brzegi i rogi obrazu zostają do rysowania i przycinania */
#handles .n, #handles .s { left: 50%; width: 30px; margin-left: -15px; cursor: ns-resize; }
#handles .e, #handles .w { top: 50%; height: 30px; margin-top: -15px; cursor: ew-resize; }
#handles .n { top: -15px; } #handles .s { top: calc(100% + 3px); } #handles .e { left: calc(100% + 3px); } #handles .w { left: -15px; }
#handles .nw { left: -15px; top: -15px; cursor: nwse-resize; } #handles .ne { left: calc(100% + 3px); top: -15px; cursor: nesw-resize; }
#handles .sw { left: -15px; top: calc(100% + 3px); cursor: nesw-resize; } #handles .se { left: calc(100% + 3px); top: calc(100% + 3px); cursor: nwse-resize; }
#opts .sw.tr { background: repeating-conic-gradient(#bbb 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
#fmtBox { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
#fmtBox[hidden] { display: none; }
/* V6: Zmień rozmiar */
#tools button.act { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; padding-top: 8px; }
#dim { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
/* V7: Zmień rozmiar — pasek od razu pod zdjęciem */
#rzBar { width: max-content; max-width: calc(100% - 32px); margin: 0 auto 56px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
#rzBar[hidden] { display: none; }
#rzBar > b { color: var(--gold2); font-weight: 600; }
#rzBar .in { display: flex; align-items: center; gap: 6px; color: var(--muted); }
#rzBar .x { color: var(--muted); }
#rzBar input[type=number] { width: 96px; font: 16px "Segoe UI", system-ui, sans-serif; padding: 5px 8px; background: #0f0e0b; color: var(--ivory); border: 1px solid var(--line); border-radius: 8px; user-select: text; }
#rzBar input[type=number]:focus { outline: none; border-color: var(--gold); }
#rzBar .chk, #rzModes label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; color: var(--ivory); font-size: 14px; }
#rzBar input[type=checkbox], #rzBar input[type=radio] { accent-color: var(--gold); }
#rzPre { display: inline-flex; flex-wrap: wrap; gap: 5px; }
#rzPre button { padding: 4px 9px; font-size: 13px; }
#rzModes { display: inline-flex; gap: 8px; align-items: center; }
#rzModes[hidden] { display: none; }
#rzModes .mut { color: var(--muted); font-size: 13px; }
#rzBar button.primary { padding: 6px 16px; }
#rzMode { font: 14px "Segoe UI", system-ui, sans-serif; padding: 5px 8px; background: #0f0e0b; color: var(--ivory); border: 1px solid var(--line); border-radius: 8px; }
/* V7: podpowiedź narzędzia w dolnym pasku (nie zasłania zdjęcia ani paska rozmiaru) */
#hint { position: static; margin: 0 0 0 14px; width: auto; max-width: none; padding: 0; border: 0; background: none; border-radius: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
#bot .grow { flex: 0 0 8px; }
#rzPre { flex-basis: 100%; justify-content: center; }
#rzMode { width: auto; }
#rzBar { margin-bottom: 24px; }
/* V8: pasek rozmiaru wąski (na szerokość zawartości), domyślnie zwinięty */
#rzBar { display: block; width: fit-content; padding: 0; overflow: hidden; }
#rzToggle { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: 0; border-radius: 0; padding: 8px 14px; color: var(--ivory); }
#rzToggle:hover { background: #2a2214; }
#rzToggle b { color: var(--gold2); font-weight: 600; }
#rzToggle .ar { color: var(--gold); width: 12px; }
#rzNow { color: var(--muted); font-size: 13px; }
#rzBar.closed #rzBody { display: none; }
#rzBody { padding: 4px 14px 12px; border-top: 1px solid var(--line); }
#rzBody .r1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 8px; }
#rzPre { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; max-width: 640px; }
#rzPre { justify-content: flex-start; max-width: none; flex-basis: auto; }
/* V9: waga pliku przy rozmiarze */
#rzKB { color: var(--muted); font-size: 13px; white-space: nowrap; }
#rzSize { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--ivory); }
#rzSize .mut { color: var(--muted); }
#rzSize b { font-weight: 600; color: var(--muted); }
#rzSize b.on { color: var(--gold2); }
/* V10: Zapisz na Dysku */
#dkSave, #dkOpen { white-space: nowrap; }
.box .mut { color: var(--muted); font-size: 14px; }
#bot button { white-space: nowrap; flex-shrink: 0; padding: 9px 14px; }
#status { flex: 0 1 auto; }
#status:not(:empty) + #hint { display: none; }   /* komunikat (np. „Zapisano na Dysku”) ważniejszy niż podpowiedź narzędzia */
/* V11: pasek miniaturek pod zdjęciem (zawsze) + „Galeria” na końcu, jak w Snagit */
#recent { display: flex; align-items: stretch; gap: 10px; padding: 8px 14px; }
#recList { flex: 1; min-width: 0; padding-bottom: 6px; scrollbar-color: var(--deep) transparent; }
#recList .rc { flex: 0 0 116px; width: 116px; min-width: 0; padding: 3px; gap: 2px; }
#recList .rc .im { height: 58px; }
#recList .rc .nm { display: none; }
#recList .rc .tm { font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#recent { padding: 6px 14px; }
#galBtn { flex: 0 0 auto; align-self: center; padding: 12px 20px; font-size: 15px; font-weight: 600; border-color: var(--deep); white-space: nowrap; }
.rc .im, .gc .im { display: flex; align-items: center; justify-content: center; background: #111; border-radius: 4px; overflow: hidden; }
.rc .im img, .gc .im img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.rc img:not([src]), .gc img:not([src]) { width: 40%; height: 40%; }
#gal { position: fixed; inset: 0; z-index: 18; background: var(--bg); display: flex; flex-direction: column; }
#gal[hidden] { display: none; }
#gal .gh { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
#gal .gt { color: var(--gold2); font-size: 17px; }
#galCount { color: var(--muted); font-size: 13px; }
#galQ { width: min(340px, 40vw); background: #0f0e0b; color: var(--ivory); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: inherit; outline: none; user-select: text; }
#galQ:focus { border-color: var(--gold); }
#gal .gbody { flex: 1; display: flex; min-height: 0; }
#galSide { width: 190px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; background: var(--panel); border-right: 1px solid var(--line); }
#galSide button { text-align: left; background: transparent; border-color: transparent; color: var(--muted); }
#galSide button.on { background: #3a2f1b; border-color: var(--gold); color: var(--gold2); }
#gal .gmain { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#galSort { display: flex; border-bottom: 1px solid var(--line); background: var(--panel2); }
#galSort button { flex: 0 0 170px; border-radius: 0; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 14px; }
#galSort button.on { background: #3a2f1b; color: var(--gold2); }
#galSort .ar { font-size: 10px; }
#galGrid { --gw: 200px; flex: 1; overflow-y: auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--gw), 1fr)); gap: 16px 14px; align-content: start; }
#galGrid .empty { color: var(--muted); grid-column: 1 / -1; }
.gc { position: relative; background: var(--panel2); border: 2px solid transparent; border-radius: 8px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.gc:hover { border-color: var(--deep); }
.gc .im { height: calc(var(--gw) * .62); }
.gc .nm { font-size: 13px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc .tm { font-size: 12px; color: var(--muted); text-align: center; }
.gc .tm.un { color: var(--gold2); }
.gc.on::after { content: "✎"; position: absolute; top: 8px; left: 8px; background: var(--gold); color: #0a0a0c; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.gc.sel { border-color: var(--gold); background: #3a2f1b; }
#gal .gf { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border-top: 1px solid var(--line); }
#galSel { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gal .zm { color: var(--muted); display: flex; align-items: center; gap: 6px; }
#galZoom { width: 130px; accent-color: var(--gold); }
#galDel { z-index: 25; }
/* V12 (6.11): panele pod zdjęciem obok siebie — „Zmień rozmiar” i „Wyostrz” (mały panel z suwakiem i procentami) */
#below { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 12px; margin: 0 16px 24px; }
#below #rzBar { margin: 0; }
#shBar { width: fit-content; max-width: calc(100% - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.45); overflow: hidden; }
#shBar[hidden] { display: none; }
#shToggle { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: 0; border-radius: 0; padding: 8px 14px; color: var(--ivory); }
#shToggle:hover { background: #2a2214; }
#shToggle b { color: var(--gold2); font-weight: 600; }
#shToggle .ar { color: var(--gold); width: 12px; }
#shNow { color: var(--gold2); font-size: 13px; font-variant-numeric: tabular-nums; }
#shBar.closed #shBody { display: none; }
#shBody { padding: 4px 14px 12px; border-top: 1px solid var(--line); }
#shOpts .r1, #shOpts .r2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 8px; }
#shOpts .lab { color: var(--muted); font-size: 13px; }
#shOpts input[type=range] { width: 200px; accent-color: var(--gold); cursor: pointer; }
#shOpts .val { min-width: 44px; color: var(--gold2); font-weight: 600; font-variant-numeric: tabular-nums; }
#shOpts .pre { display: inline-flex; gap: 5px; }
#shOpts .opt { padding: 4px 10px; font-size: 13px; }
#shOpts .opt.on { border-color: var(--gold); background: #3a2f1b; color: var(--gold2); }
#shOpts .opt.primary { background: var(--gold); color: #0a0a0c; border-color: var(--gold); font-weight: 600; padding: 5px 16px; }
#shOpts .opt:disabled { opacity: .45; cursor: default; }
#shBody > .mut { margin-top: 8px; color: var(--muted); font-size: 12px; }
/* V13 (8.11.2026): zdjęcie z innego zrzutu — przeciąganie miniaturki na płótno */
#wrap.dropOk { outline: 3px dashed var(--gold); outline-offset: 4px; }
#dragGhost { position: fixed; z-index: 9999; pointer-events: none; transform: translate(-50%, -60%); width: 140px; padding: 4px; background: rgba(10,10,12,.88); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 26px rgba(0,0,0,.55); opacity: .85; }
#dragGhost.ok { border-color: var(--gold); opacity: 1; }
#dragGhost img { display: block; width: 100%; max-height: 96px; object-fit: contain; border-radius: 4px; }
body.cdrag, body.cdrag * { cursor: copy !important; user-select: none; }
.rc img, .gc img { -webkit-user-drag: none; }

/* V14 (9.11.2026): pasek rozmiaru pod wstawionym zdjęciem */
#imgSz { position: absolute; z-index: 6; display: flex; gap: 2px; padding: 3px; background: rgba(24,24,27,.94); border: 1px solid rgba(212,175,55,.55); border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.5); }
#imgSz[hidden] { display: none; }
#imgSz button { min-width: 52px; height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #e7e5e4; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; }
#imgSz button:hover { background: rgba(255,255,255,.1); }
#imgSz button.on { background: #d4af37; color: #1a1a1d; }
@media (max-width: 600px) { #imgSz button { min-width: 44px; height: 36px; padding: 0 6px; } }
#imgSz button.fit { border-left: 1px solid rgba(255,255,255,.18); border-radius: 0 7px 7px 0; margin-left: 2px; }
#imgSz button.fit.on { border-left-color: transparent; }

/* V16 (9.11.2026): widok w panelu „Zmień rozmiar”, ✕ w rogu paneli */
#rzBar, #shBar { position: relative; }
.pclose { position: absolute; top: 4px; right: 6px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #e7e5e4; font-size: 15px; line-height: 1; cursor: pointer; }
.pclose:hover { background: rgba(229,57,53,.85); color: #fff; }
#rzBar.closed .pclose, #shBar.closed .pclose { display: none; }
#rzToggle, #shToggle { padding-right: 40px; }
.rzView { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 10px; }
.rzView .zq, .rzView #fit { padding: 4px 10px; }
.rzInfo { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
#imgSz { padding-right: 34px; }
#imgSz .pclose { top: 4px; right: 3px; min-width: 0; width: 28px; height: 30px; padding: 0; border-left: 1px solid rgba(255,255,255,.18); border-radius: 0 7px 7px 0; }
@media (max-width: 600px) { #imgSz { padding-right: 28px; } #imgSz button { min-width: 38px; padding: 0 4px; font-size: 13px; } #imgSz .pclose { width: 24px; } }

/* V17: rozmiar w nagłówku „Zmień rozmiar” */
#rzToggle .rzHd { color: var(--ivory); opacity: .85; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 600px) { #rzToggle { flex-wrap: wrap; row-gap: 2px; } #rzToggle b { white-space: nowrap; } #rzToggle .rzHd { white-space: normal; text-align: left; } }

/* PNP_PISACZEK_ZRZUT_EDYTOR_V18: czerwony krzyżyk „Zrób zrzut ekranu” na samej górze */
.brand { display: flex; align-items: center; gap: 12px; }
#shotBtn { display: inline-flex; align-items: center; gap: 9px; padding: 6px 16px 6px 10px; border: 1.5px solid #de1c28; border-radius: 9px;
  background: rgba(222, 28, 40, .14); color: var(--ivory); font: inherit; font-size: 15px; cursor: pointer; white-space: nowrap; }
#shotBtn b { font-weight: 700; color: var(--ivory); }
#shotBtn:hover { background: rgba(222, 28, 40, .28); }
#shotBtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#shotBtn .xh { width: 26px; height: 26px; flex: none; }
#shotBtn[hidden], #brandT[hidden] { display: none; }
@media (max-width: 760px) {   /* telefon / wąskie okno: pasek zawija się — kolory i grubość w osobnym wierszu */
  #top { flex-wrap: wrap; row-gap: 6px; }
  #top .brand { order: 1; }
  #top .right { order: 2; margin-left: auto; }
  #opts { order: 3; flex: 1 1 100%; flex-wrap: wrap; row-gap: 6px; }
  #shotBtn { font-size: 14px; padding: 5px 12px 5px 8px; }
}

/* PNP_PISACZEK_ZRZUT_EDYTOR_V19: pod zdjęciem 3 duże przyciski; panele „Zmień rozmiar” i „Widok” otwierane z nich */
#bar3 { flex: 1 1 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }   /* krzyżyk zawsze dokładnie na środku */
#bar3 #b3Rz { justify-self: end; } #bar3 #b3View { justify-self: start; }
#bar3[hidden], #vwBar[hidden] { display: none; }
#bar3 button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 48px; padding: 0 20px; font-size: 16px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ivory); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.35); white-space: nowrap; }
#bar3 button:hover { background: #2a2214; border-color: var(--gold); }
#bar3 button.on { background: #2a2214; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
#bar3 button b { font-weight: 600; }
#bar3 .b3n { color: var(--gold2); font-variant-numeric: tabular-nums; }
#bar3 .ar { color: var(--gold); font-size: 13px; }
#bar3 .b3i { width: 20px; height: 20px; color: var(--gold2); flex: 0 0 auto; }
#bar3 #b3Shot { height: 56px; padding: 0 26px 0 18px; font-size: 17px; border: 2px solid #de1c28; background: rgba(222,28,40,.16); }
#bar3 #b3Shot:hover { background: rgba(222,28,40,.30); border-color: #ff3b47; }
#bar3 #b3Shot[hidden] { display: none; }
#b3Shot .xh { width: 28px; height: 28px; flex: 0 0 auto; }
#rzToggle, #shToggle { display: none; }
#rzBar.closed, #shBar.closed { display: none; }
#rzBody, #shBody { border-top: 0; padding-top: 12px; padding-right: 44px; }
#vwBar { position: relative; width: fit-content; max-width: calc(100% - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,.45); padding: 12px 48px 12px 16px; }
#vwBar .rzView { margin: 0; gap: 8px; }
#vwBar .rzView .mut { font-size: 15px; margin-right: 4px; }
#vwBar .rzView button { height: 40px; min-width: 46px; font-size: 15px; padding: 0 12px; }
#vwBar #zval { min-width: 58px; font-size: 16px; color: var(--ivory); font-weight: 600; }
#vwBar #fit { border-color: var(--gold); color: var(--gold2); font-weight: 600; }
@media (max-width: 760px) { #bar3 { flex: 0 0 auto; width: 100%; } }
/* panele „Widok” i „Zmień rozmiar” wyskakują NAD przyciskami (na wierzchu zdjęcia) — zawsze widoczne, Dopasuj ich nie przesuwa */
#below { position: relative; }
#below > #rzBar, #below > #vwBar { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 30; margin: 0;
  width: max-content; max-width: min(820px, calc(100vw - 24px)); box-shadow: 0 10px 34px rgba(0,0,0,.65); border-color: var(--gold); }
@media (max-width: 760px) { #below > #rzBar, #below > #vwBar { position: relative; left: auto; bottom: auto; transform: none; margin: 10px auto 0; max-width: calc(100vw - 16px); } #below > #rzBar .r1 { justify-content: center; } }   /* telefon: pod przyciskami (tam jest miejsce) */
@media (max-width: 600px) {
  #bar3 { gap: 8px; grid-template-columns: 1fr 1fr; }
  #bar3 #b3Shot { grid-column: 1 / -1; grid-row: 1; }
  #bar3 #b3Rz, #bar3 #b3View { justify-self: stretch; padding: 0 10px; font-size: 15px; min-width: 0; }
  #bar3 #b3Rz .b3n, #bar3 #b3Rz .b3i, #bar3 #b3View .b3i { display: none; }
  #bar3 #b3Rz, #bar3 #b3View { height: 44px; gap: 6px; font-size: 14px; }
  #bar3 #b3Shot { height: 52px; }
  #vwBar { padding: 10px 40px 10px 10px; }
}

/* PNP_PISACZEK_ZRZUT_EDYTOR_V20: górny pasek w trzech częściach — krzyżyk dokładnie na środku; pod zdjęciem Zmień rozmiar · Widok · Wyostrz */
#top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
#topL { display: flex; align-items: center; gap: 10px; min-width: 0; }
#topL #opts { gap: 6px; }
#top #dim { display: none; }   /* rozmiar jest na przycisku „Zmień rozmiar” pod zdjęciem — lewa część paska mieści kolor i grubość */
#topL .brand:has(#brandT[hidden]) { display: none; }
#topMid { display: flex; justify-content: center; padding: 0 10px; }
#top .right { justify-self: end; }
#bar3 { display: flex; justify-content: center; flex-wrap: wrap; }
#bar3 #b3Sh .b3n:empty { display: none; }
#below > #shBar { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 30; margin: 0;
  width: max-content; max-width: min(820px, calc(100vw - 24px)); box-shadow: 0 10px 34px rgba(0,0,0,.65); border-color: var(--gold); }
@media (max-width: 760px) {
  #top { display: flex; }
  #topL { display: contents; }
  #topMid { order: 0; flex: 1 1 100%; padding: 0; }
  #below > #shBar { position: relative; left: auto; bottom: auto; transform: none; margin: 10px auto 0; max-width: calc(100vw - 16px); }
}
@media (max-width: 600px) {
  #bar3 #b3Rz, #bar3 #b3View, #bar3 #b3Sh { flex: 1 1 0; justify-self: auto; padding: 0 8px; font-size: 14px; height: 44px; gap: 6px; min-width: 0; }
  #bar3 #b3Sh .b3i, #bar3 #b3Sh .b3n { display: none; }
}

/* PNP_PISACZEK_ZRZUT_EDYTOR_V21: panel „Widok” bez „Dopasuj” */

/* PNP_PISACZEK_ZRZUT_EDYTOR_V22: skróty klawiszowe w ⚙ Ustawieniach */
#prefs { max-height: calc(100vh - 76px); overflow: auto; }
#prefs #keysBox { margin: 12px 0 10px; padding-top: 12px; border-top: 1px solid var(--deep); }
#prefs #prtscBox + #keysBox { margin-top: 10px; }
#prefs .krow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; }
#prefs .kbd { min-width: 128px; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--deep); border-bottom-width: 3px;
  background: rgba(255,255,255,.06); color: var(--ink, #fff); font: 700 14px/1 ui-monospace, Consolas, monospace; cursor: pointer; white-space: nowrap; }
#prefs .kbd:hover { border-color: var(--gold); }
#prefs .kbd.rec { border-color: var(--gold); color: var(--gold); font-family: inherit; animation: zrKeyRec 1s ease-in-out infinite; }
@keyframes zrKeyRec { 50% { box-shadow: 0 0 0 3px rgba(212,175,55,.35); } }
#prefs .note.bad { color: #ff8a80; }
#prefs .klink { background: none; border: 0; padding: 4px 0; color: var(--gold); text-decoration: underline; cursor: pointer; font-size: 14px; }
@media (max-width: 600px) { #prefs { left: 8px; right: 8px; width: auto; } #prefs .kbd { min-width: 110px; } }

/* PNP_PISACZEK_ZRZUT_EDYTOR_V23: „⬇ Pod spodem” / „➡ Obok” na pasku zaznaczonego zdjęcia */
#imgSz button.pl { border-left: 1px solid rgba(255,255,255,.18); border-radius: 0; margin-left: 2px; white-space: nowrap; }
#imgSz button.pl + button.pl { border-left: 0; margin-left: 0; }
@media (max-width: 600px) { #imgSz { flex-wrap: wrap; max-width: calc(100vw - 16px); } #imgSz button.pl { flex: 1 1 40%; } }

/* PNP_PISACZEK_ZRZUT_EDYTOR_V24: „● Nagraj wideo” obok czerwonego krzyżyka */
#topMid { gap: 8px; flex-wrap: wrap; }
#recBtn { display: inline-flex; align-items: center; gap: 9px; padding: 6px 16px 6px 12px; border: 1.5px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.05);
  color: var(--ivory); font-family: inherit; font-size: 15px; line-height: 1; cursor: pointer; white-space: nowrap; min-height: 41px; }
#recBtn b { font-weight: 700; }
#recBtn .rd { width: 14px; height: 14px; border-radius: 50%; background: #de1c28; box-shadow: 0 0 0 3px rgba(222,28,40,.25); flex: none; }
#recBtn:hover { background: rgba(255,255,255,.12); border-color: #de1c28; }
#recBtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#recBtn[hidden] { display: none; }
@media (max-width: 760px) { #recBtn { font-size: 14px; padding: 5px 12px 5px 10px; min-height: 0; } }

/* PNP_PISACZEK_ZRZUT_EDYTOR_V25: pasek narzędzi w kolumnach (tyle wierszy, ile mieści okno), tło-gradienty, okno linku z QR, podpis w Ustawieniach */
body { grid-template-columns: auto 1fr; }
#tools { display: grid; grid-template-columns: repeat(2, 78px); grid-auto-rows: 60px; gap: 2px; align-content: start; overflow-y: auto; overflow-x: hidden; }
#tools button { height: 60px; padding: 4px 2px; justify-content: center; overflow: hidden; }
#tools button span { display: block; max-width: 100%; }
#opts .sw.gr { border-radius: 8px; width: 30px; }
#opts .opt:disabled { opacity: .45; cursor: default; }
#lnkBox .box { text-align: center; }
#lnkUrl { width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0d0d10; color: var(--ivory); font: 14px/1.2 Consolas, monospace; text-align: center; }
#lnkQr { display: block; margin: 14px auto 6px; width: 220px; height: 220px; border-radius: 10px; background: #fff; }
#lnkQr[hidden] { display: none; }
#lnkMsg { min-height: 20px; font-size: 14px; color: #6fcf8f; margin-bottom: 4px; }
#wmBox input[type=text] { width: 100%; box-sizing: border-box; margin: 6px 0 4px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: #0d0d10; color: var(--ivory); font: inherit; user-select: text; }
#wmPos { display: inline-flex; gap: 4px; }
#wmPos button { width: 34px; height: 30px; padding: 0; border-radius: 7px; font-size: 16px; }
#wmPos button.on { border-color: var(--gold); background: #3a2f1b; color: var(--gold2); }
@media (max-width: 600px) {
  #tools { grid-template-columns: repeat(2, 44px); grid-auto-rows: 46px; padding: 6px 4px; }
  #tools button { height: 46px; padding: 0; }
  #tools button span { display: none; }
  #tools button svg { width: 24px; height: 24px; }
}

/* PNP_PISACZEK_ZRZUT_EDYTOR_V26 */
#pinBtn[hidden], #afterBox[hidden] { display: none; }

/* PNP_PISACZEK_ZRZUT_EDYTOR_V27: „Krok po kroku” obok „Nagraj wideo” */
#stepsBtn { display: inline-flex; align-items: center; gap: 9px; padding: 6px 16px 6px 10px; border: 1.5px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.05);
  color: var(--ivory); font-family: inherit; font-size: 15px; line-height: 1; cursor: pointer; white-space: nowrap; min-height: 41px; }
#stepsBtn b { font-weight: 700; }
#stepsBtn .sn { width: 20px; height: 20px; border-radius: 50%; background: #de1c28; color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; flex: none; }
#stepsBtn:hover { background: rgba(255,255,255,.12); border-color: #de1c28; }
#stepsBtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#stepsBtn[hidden] { display: none; }
@media (max-width: 760px) { #stepsBtn { font-size: 14px; padding: 5px 12px 5px 8px; min-height: 0; } }

/* PNP_PISACZEK_ZRZUT_EDYTOR_V28: pieczątki na pasku opcji; niski ekran — pasek narzędzi w 3 kolumnach */
#opts .wd.st { min-width: 34px; height: 30px; padding: 2px 4px; font-size: 18px; line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
#opts .wd.zo { min-width: 34px; padding: 4px 6px; font-size: 12px; }
#opts { gap: 6px; }
@media (max-height: 900px) and (min-width: 601px) { #tools { grid-template-columns: repeat(3, 70px); } #tools button { font-size: 11.5px; } }

/* PNP_PISACZEK_ZRZUT_EDYTOR_V29 */
#winNote[hidden], #curRow[hidden] { display: none; }
#curRow { margin-top: 6px; }

/* PNP_PISACZEK_ZRZUT_EDYTOR_V30: niski ekran — narzędzia niższe, a przy bardzo niskim 4 kolumny (wszystkie 24 widać bez przewijania) */
@media (max-height: 800px) and (min-width: 601px) { #tools { grid-auto-rows: 52px; } #tools button { height: 52px; font-size: 11px; gap: 1px; } #tools button svg { width: 20px; height: 20px; } }
@media (max-height: 700px) and (min-width: 601px) { #tools { grid-template-columns: repeat(4, 62px); grid-auto-rows: 50px; } #tools button { height: 50px; font-size: 10.5px; } }
