/* Shared picture building blocks (imagekit.js) – works with the colours of the workbench and of the Managed Hub. */
.ik-status { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px;
  border: 1px solid var(--line); background: var(--card, var(--panel)); color: var(--text); }
.ik-status.hidden { display: none; }
.ik-status.busy { border-color: var(--accent); }
.ik-status.done { border-color: #2e9e5b; color: #2e9e5b; }
.ik-status.error { border-color: #d4473f; color: #d4473f; background: color-mix(in srgb, #d4473f 8%, transparent); }
.ik-bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 18%, transparent); overflow: hidden; position: relative; }
.ik-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; transition: width .3s; }
.ik-bar.indet i { width: 35%; animation: ik-indet 1.2s ease-in-out infinite; }
@keyframes ik-indet { 0% { left: -35%; } 100% { left: 100%; } }

.ik-modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: rgba(10, 12, 16, .45); backdrop-filter: blur(3px); }
.ik-dialog { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--card, var(--panel)); color: var(--text);
  border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.ik-dialog h2 { margin: 0 0 6px; font-size: 19px; }
.ik-dialog p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ik-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.ik-opts button, .ik-targets button, .ik-actions button, .ik-pick, .ik-reuse-btn {
  font: inherit; color: var(--text); background: var(--bg2, var(--bg)); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.ik-opts button { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 12px 14px; }
.ik-opts button span { font-size: 12.5px; color: var(--muted); }
.ik-opts button.first { border-color: var(--accent); }
.ik-opts button:hover, .ik-targets button:hover, .ik-pick:hover, .ik-reuse-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.ik-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.ik-actions button { padding: 9px 16px; }
.ik-actions .primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.ik-actions button:disabled { opacity: .5; cursor: default; }
.ik-msg { color: #d4473f; font-size: 13px; min-height: 0; }
.ik-msg:not(:empty) { margin-top: 10px; }

.ik-save { display: flex; gap: 14px; align-items: center; }
.ik-thumb { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; flex: none; }
.ik-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ik-thumb.checker, .ik-pick .checker { background: repeating-conic-gradient(#e4e6ea 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.ik-field { display: flex; flex-direction: column; gap: 5px; flex: 1; font-size: 13px; color: var(--muted); }
.ik-field input { font: inherit; font-size: 15px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--input, var(--bg)); color: var(--text); }

.ik-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ik-pick { display: flex; flex-direction: column; gap: 4px; padding: 8px; text-align: left; }
.ik-pick .ik-thumb { width: 100%; height: 96px; }
.ik-pick b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ik-pick small { color: var(--muted); font-size: 11.5px; }
.ik-pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.ik-which { display: grid; gap: 8px; margin-bottom: 14px; }
.ik-which label { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.ik-which label span { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.ik-which label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ik-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ik-targets button { padding: 11px 12px; text-align: left; font-weight: 600; }
.ik-reuse-btn { width: 100%; padding: 10px 12px; font-weight: 600; text-align: left; }
.ik-reuse-btn:disabled { opacity: .5; cursor: default; }

.ik-toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 500;
  background: #1d2430; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; transition: .2s; max-width: calc(100% - 32px); }
.ik-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* „Bild löschen“ – clearly visible, in every hub with a loaded picture */
.ik-clear { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 8px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, #d4473f 55%, var(--line)); color: #d4473f;
  background: color-mix(in srgb, #d4473f 7%, transparent); }
.ik-clear:hover { background: color-mix(in srgb, #d4473f 14%, transparent); }
.ik-clear.hidden { display: none; }
.ik-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ik-row > * { flex: 1 1 auto; }
.ik-savebtn { font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--accent); color: var(--accent);
  background: transparent; cursor: pointer; }
.ik-savebtn:disabled { opacity: .5; cursor: default; }
.ik-libbtn { font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--line); background: transparent; color: var(--text); cursor: pointer; width: 100%; margin-top: 8px; }
.ik-libbtn:hover { border-color: var(--accent); color: var(--accent); }

/* Original | Ergebnis – two separate frames side by side, one under the other on narrow screens */
.ik-pane-label { position: absolute; top: 8px; left: 10px; z-index: 3; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; background: rgba(15, 20, 28, .72); color: #fff; pointer-events: none; }
.ik-empty-result { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); font-size: 14px; pointer-events: none; }
.ik-empty-result b { display: block; color: var(--text); margin-bottom: 4px; }
