/* Image Studio keeps scrolling inside its panel and canvas on desktop. */
.im-studio [hidden] { display: none !important; }
.im-studio button, .im-studio input, .im-studio select { font: inherit; }
.im-studio button { cursor: pointer; }
.im-studio button:disabled { cursor: not-allowed; opacity: .5; }
.im-studio button:active:not(:disabled) { transform: scale(.97); }
.im-workspace { display: grid; grid-template-columns: 76px 320px minmax(0, 1fr); min-height: 0; flex: 1; overflow: hidden; }
.im-rail { display: flex; flex-direction: column; gap: 6px; padding: 12px 6px; border-right: 1px solid var(--wb-border); background: var(--wb-surface-solid); overflow-y: auto; }
.im-rail button { display: grid; justify-items: center; gap: 6px; padding: 12px 2px; border: 0; border-radius: var(--wb-r-sm); color: var(--wb-text-soft); background: transparent; font-size: .65rem; line-height: 1.25; }
.im-rail button[aria-selected="true"] { color: var(--wb-accent); background: var(--wb-surface-sunk); }
.im-rail button:active, .im-tools button:active { transform: scale(.97); }
.im-panel { min-width: 0; overflow-y: auto; padding: 22px 18px; border-right: 1px solid var(--wb-border); background: var(--wb-surface-solid); }
.im-panel h2 { margin: 0 0 18px; font: 650 1.25rem/1.2 'Bricolage Grotesque', sans-serif; }
.im-field { display: grid; gap: 7px; margin: 0 0 17px; font-size: .85rem; color: var(--wb-text); }
.im-field > span, .im-check > span { line-height: 1.4; }
.im-field :is(input:not([type="checkbox"]), select) { width: 100%; min-width: 0; border: 1px solid var(--wb-border-strong); border-radius: var(--wb-r-sm); padding: 9px 10px; color: var(--wb-text); background: var(--wb-surface-sunk); }
.im-field input[type="range"] { padding: 0; accent-color: var(--wb-accent); }
.im-field input[type="color"] { height: 42px; padding: 4px; }
.im-check { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0; font-size: .84rem; }
.im-check input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--wb-accent); }
.im-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.im-note { margin: 12px 0; font-size: .82rem; line-height: 1.5; color: var(--wb-text-soft); overflow-wrap: anywhere; }
.im-panel .im-note { padding-bottom: 4px; }
.im-drop { display: grid; justify-items: center; gap: 10px; padding: 24px 14px; margin-bottom: 18px; border: 1px dashed var(--wb-border-strong); border-radius: var(--wb-r-lg); color: var(--wb-text-soft); text-align: center; cursor: pointer; }
.im-drop strong { color: var(--wb-text); }
.im-drop span { font-size: .78rem; line-height: 1.5; }
.im-studio.is-dragging .im-stage, .im-drop:hover { outline: 2px solid var(--wb-accent); outline-offset: -2px; }
.im-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.im-tools button, .im-buttons button { border: 1px solid var(--wb-border); border-radius: var(--wb-r-pill); background: var(--wb-surface-solid); color: var(--wb-text-soft); padding: 7px 10px; font-size: .78rem; }
.im-tools button[aria-pressed="true"] { color: var(--wb-accent); border-color: var(--wb-accent); }
.im-files { display: grid; gap: 8px; }
.im-file { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; border: 1px solid var(--wb-border); border-radius: var(--wb-r-sm); min-width: 0; padding: 4px; }
.im-file.is-selected { border-color: var(--wb-accent); }
.im-file > button { border: 0; background: transparent; color: var(--wb-text); border-radius: var(--wb-r-sm); padding: 7px; }
.im-pick { display: flex; gap: 8px; text-align: left; align-items: center; min-width: 0; }
.im-pick img { width: 38px; height: 38px; object-fit: contain; border-radius: var(--wb-r-sm); background: var(--wb-surface-sunk); }
.im-pick span { display: grid; min-width: 0; gap: 3px; }
.im-pick strong { font-size: .77rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-pick small { color: var(--wb-text-soft); font-size: .71rem; }
.im-file .im-note { grid-column: 1 / -1; font-size: .75rem; margin: 5px; }
.im-canvas { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; padding: 18px; gap: 12px; background: var(--wb-surface-sunk); }
.im-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; background: var(--wb-surface); border: 1px solid var(--wb-border); border-radius: var(--wb-r-pill); backdrop-filter: blur(var(--wb-blur)); }
.im-toolbar label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .75rem; padding-inline: 6px; }
.im-toolbar select { max-width: 140px; color: var(--wb-text); background: var(--wb-surface-solid); border: 1px solid var(--wb-border); border-radius: var(--wb-r-sm); padding: 5px; }
.im-stage { position: relative; display: grid; align-items: center; justify-items: center; min-height: 270px; flex: 1 0 300px; padding: 18px; overflow: auto; border-radius: var(--wb-r-lg); }
.im-stage[data-background="checker"] { --im-art-bg: repeating-conic-gradient(var(--wb-surface-solid) 0% 25%, var(--wb-border) 0% 50%) 50% / 20px 20px; background: var(--im-art-bg); }
/* These are artwork inspection surfaces, independent of the panel theme. */
.im-stage[data-background="light"] { --im-art-bg: #fff; background: var(--im-art-bg); }
.im-stage[data-background="dark"] { --im-art-bg: #202124; background: var(--im-art-bg); }
.im-empty { max-width: 460px; padding: 26px; background: var(--wb-surface-solid); }
.im-empty h2 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.5rem; }
.im-plate { max-width: 100%; width: 100%; box-shadow: var(--wb-shadow); }
.im-plate .wk-bezel__core { background: transparent; }
.im-plate .wk-compare { background: var(--im-art-bg); }
.im-is-pdf :is(.wk-compare__line, .wk-compare__tag, input) { display: none; }
.im-is-pdf .wk-compare__after { clip-path: none; }
.im-plate .wk-compare { width: 100%; height: min(49vh, 520px); }
.im-plate .wk-compare img { height: 100%; max-height: none; object-fit: contain; }
.im-stage.is-actual .im-plate { max-width: none; width: max-content; justify-self: start; }
.im-stage.is-actual .wk-compare { width: var(--im-width); height: var(--im-height); }
.im-skeleton { position: absolute; inset: 18px; min-height: 230px; z-index: 2; pointer-events: none; }
.im-info { display: flex; flex-wrap: wrap; gap: 5px 16px; font-size: .8rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--wb-text-soft); }
.im-info strong { width: 100%; color: var(--wb-text); }
.im-notice { margin: 0; padding: 10px 12px; border-radius: var(--wb-r-sm); background: var(--wb-warn-bg); color: var(--wb-text); font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; }
.im-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.im-strip { display: flex; gap: 8px; overflow-x: auto; padding: 3px; min-width: 0; flex: 0 0 auto; }
.im-strip button { display: grid; flex: 0 0 90px; gap: 5px; padding: 6px; border: 1px solid var(--wb-border); border-radius: var(--wb-r-sm); background: var(--wb-surface-solid); color: var(--wb-text-soft); text-align: left; min-width: 0; }
.im-strip button[aria-pressed="true"] { border-color: var(--wb-accent); }
.im-strip img { width: 100%; height: 44px; object-fit: contain; }
.im-strip span { max-width: 78px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .68rem; }
.im-total { margin: 0; font-size: .8rem; color: var(--wb-text-soft); font-variant-numeric: tabular-nums; }
.im-exif { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: .82rem; }
.im-exif dt { color: var(--wb-text-soft); }
.im-exif dd { margin: 0; overflow-wrap: anywhere; }
.im-saved .wb-lib { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; }
.im-saved .wb-card__head { display: none; }
.im-saved .wb-lib:not([hidden]) + .im-saved__empty { display: none; }
@media (min-width: 900px) { :root[data-focus] .im-studio { display: flex; flex-direction: column; } }
@media (max-width: 899px) {
  .im-workspace { display: flex; flex-direction: column; overflow: visible; }
  .im-canvas { order: 0; overflow: visible; padding: 12px; }
  .im-rail { order: 1; flex-direction: row; overflow-x: auto; border: 0; border-block: 1px solid var(--wb-border); padding: 6px; }
  .im-rail button { flex: 0 0 76px; padding: 9px 4px; }
  .im-panel { order: 2; overflow: visible; border: 0; padding: 20px 16px; }
  .im-stage { flex: 0 0 auto; min-height: 220px; max-height: 360px; padding: 8px; }
  .im-plate .wk-compare { height: 240px; }
  .im-toolbar { border-radius: var(--wb-r-sm); }
  .im-toolbar label > span { display: none; }
  .im-stage.is-actual { justify-items: start; }
  .im-studio .wk-studio__acts .wk-cta { padding: 5px 5px 5px 12px; }
  .im-studio .wk-studio__acts .wk-cta > span:first-child { display: inline; font-size: .75rem; }
  .im-studio .wk-studio__acts { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .im-studio * { transition: none !important; animation: none !important; } .im-studio button:active { transform: none; } }
@media (prefers-reduced-transparency: reduce) { .im-toolbar { background: var(--wb-surface-solid); backdrop-filter: none; } }
@media (max-width: 599px) {
  .im-studio .wk-studio__acts { flex-basis: 100%; flex-wrap: wrap; margin-left: 0; justify-content: flex-end; }
  .im-studio .wk-studio__acts .wb-credits { margin-right: auto; }
}

/* Dodaj do WordPress drawer */
.im-wp p { margin: 0; color: var(--wb-text-soft); }
.im-wp-group { display: grid; gap: 8px; }
.im-wp-group small { color: var(--wb-text-soft); }
.im-wp-group input[type=text], .im-wp-search { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--wb-border-strong); border-radius: var(--wb-r-sm); background: var(--wb-surface-solid); color: var(--wb-text); font: inherit; }
.im-wp-sites { display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.im-wp-site { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--wb-border); border-radius: var(--wb-r-sm); background: var(--wb-surface-solid); cursor: pointer; }
.im-wp-site:has(input:checked) { border-color: var(--wb-accent); }
.im-wp-site input { width: 18px; height: 18px; accent-color: var(--wb-accent); flex-shrink: 0; }
.im-wp-site span { display: grid; min-width: 0; }
.im-wp-site strong { overflow-wrap: anywhere; }
.im-wp-site small { color: var(--wb-text-soft); }
.im-wp-results { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.im-wp-results li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--wb-r-sm); background: var(--wb-surface-sunk); }
.im-wp-name { display: grid; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.im-wp-name small { font-weight: 400; color: var(--wb-text-soft); }
.im-wp-results li > span:last-child, .im-wp-results li > a { flex-shrink: 0; text-align: right; max-width: 55%; }
.im-wp-results .is-ok { color: var(--wb-ok); font-weight: 600; }
.im-wp-results .is-fail { color: var(--wb-bad); }
