/* Конвертер зображень: розмітка поверх спільної теми (theme.css). Полотно-сітка на весь екран, меню іконками (як у колажі). */
:root { --accent: #e0a458; --accent-hi: #f0c58a; --accent-glow: rgba(224, 164, 88, .14); }
html, body { height: 100%; }
body { display: flex; flex-direction: column; line-height: 1.45;
  background: radial-gradient(1200px 420px at 50% -120px, rgba(224, 164, 88, .09), transparent 70%), var(--bg); }
header.top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 18px;
  background: linear-gradient(180deg, var(--panel), var(--bg-elev)); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--ff-ui); font-weight: 850; text-transform: uppercase; font-size: 20px; margin-right: 8px; white-space: nowrap; letter-spacing: .07em; }
.brand svg { width: 24px; height: 24px; color: var(--accent); flex: none; }
.brand span { color: var(--accent); text-shadow: 0 0 14px currentColor; }
.spacer { flex: 1; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-main { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #b4914f); color: var(--gold-ink); border-color: #d6bb82; font-weight: 700; }
.btn-copy { background: transparent; border-color: var(--gold-lo); color: var(--gold-hi); font-weight: 600; }
.btn-copy:hover { background: var(--gold-glow); border-color: var(--gold); }
details.how { margin: 12px 18px 0; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 10px 4px; }

.work { flex: 1; position: relative; min-height: 520px; height: calc(100vh - 118px); overflow: hidden; margin-top: 12px; background: repeating-conic-gradient(#15151a 0 25%, #1a1a20 0 50%) 0 0 / 20px 20px; }
.stagebox { position: absolute; inset: 0; padding: 14px 14px 112px 84px; transition: padding-left .15s; overflow: auto; }
.work.shift .stagebox { padding-left: 440px; }
.stagebox.over { outline: 2px dashed var(--accent); outline-offset: -8px; }
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--faint); pointer-events: none; }
.empty[hidden] { display: none; }

.rail { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.rail button { width: 62px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; background: color-mix(in srgb, var(--panel) 92%, transparent); }
.rail button svg { width: 22px; height: 22px; }
.rail button.on, #btnBlank.on, .seg button.on, .modes button.on { background: var(--accent-glow); border-color: var(--accent); color: var(--accent-hi); }
.drawer { position: absolute; left: 82px; top: 10px; bottom: 10px; width: min(340px, calc(100vw - 100px)); z-index: 4; overflow: auto; background: color-mix(in srgb, var(--panel) 96%, transparent); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.drawer[hidden] { display: none; }
.drawer section { display: none; flex-direction: column; gap: 10px; } .drawer section.on { display: flex; }
.drawer h2 { margin: 6px 0 2px; font-family: var(--ff-ui); font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: var(--accent); font-weight: 600; }
.x { position: absolute; right: 8px; top: 6px; width: 28px; height: 28px; padding: 0; line-height: 1; font-size: 18px; z-index: 2; }
.drawer label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.drawer .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ctls { display: flex; flex-direction: column; gap: 10px; } .ctls[hidden], .hint[hidden] { display: none; }
.modes { display: flex; flex-direction: column; gap: 6px; } .modes button { text-align: left; }
.hint { color: var(--faint); font-size: 12.5px; margin: 0; }
.bar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 6px 10px; border-radius: var(--r-md); background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line); max-width: calc(100% - 24px); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: none; padding: 6px 12px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--gold-lo); padding: 8px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.toast.on { opacity: 1; }
@media (max-width: 760px) { .stagebox { padding: 70px 8px 120px 8px; } .work.shift .stagebox { padding-left: 8px; } .bar { bottom: 8px; } }
.work.shift .bar { left: calc(50% + 177px); max-width: calc(100% - 470px); }
@media (max-width: 760px) { .work.shift .bar { left: 50%; max-width: calc(100% - 24px); } }

.grid { --th: 220px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--th), 1fr)); gap: 12px; align-items: start; }
.card { position: relative; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px; content-visibility: auto; contain-intrinsic-size: auto 240px; animation: pop .35s ease both; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px var(--accent-glow); }
.frame { position: relative; overflow: hidden; border-radius: 6px; background: repeating-conic-gradient(#1b1b21 0 25%, #222229 0 50%) 0 0 / 14px 14px; cursor: grab; touch-action: none; width: 100%; }
.frame.drag { cursor: grabbing; }
.frame img { position: absolute; display: block; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.cap { display: flex; flex-direction: column; gap: 1px; padding: 6px 2px 0; font-size: 12px; color: var(--muted); }
.cap .nm { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap .res { color: var(--accent-hi); min-height: 1em; } .cap .res.bad { color: #e8924a; }
.card .del { position: absolute; right: 10px; top: 10px; width: 24px; height: 24px; padding: 0; line-height: 1; opacity: 0; transition: opacity .15s; z-index: 2; }
.card:hover .del, .card.sel .del { opacity: 1; }
.card.err .frame { display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; color: #e8924a; font-size: 12px; text-align: center; padding: 8px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }
.drawer .three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.drawer .three button { padding: 6px 4px; font-size: 12px; }
.drawer label.row { flex-direction: row; align-items: center; gap: 8px; }
.drawer input[type=text] { width: 100%; }
.seg.wide { display: grid; grid-template-columns: repeat(4, 1fr); }
.seg.wide button:disabled { opacity: .4; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips button { padding: 4px 9px; font-size: 12px; }
.chips button.on { background: var(--accent-glow); border-color: var(--accent); color: var(--accent-hi); }
.zoom { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); } .zoom input { width: 90px; }
[hidden] { display: none !important; }
