/* ---------- Image Converter (iv-*) ---------- */
/* Dua kolom: antrean file di kiri, pengaturan output di kanan. */
#iv-app .iv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  #iv-app .iv-grid {
    grid-template-columns: 1fr;
  }
}

#iv-app .iv-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* ---------- dropzone ---------- */
#iv-app .iv-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 20px;
  background: var(--bg);
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
#iv-app .iv-drop:hover,
#iv-app .iv-drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
#iv-app .iv-drop:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#iv-app .iv-drop-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#iv-app .iv-drop-title {
  margin: 8px 0 0;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
}
#iv-app .iv-browse {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
#iv-app .iv-drop-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- antrean file & hasil ---------- */
#iv-app .iv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#iv-app .iv-queue-head,
#iv-app .iv-res-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
#iv-app .iv-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
#iv-app .iv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}
#iv-app .iv-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: var(--card);
}
#iv-app .iv-file {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
#iv-app .iv-name {
  font-size: 0.89rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#iv-app .iv-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#iv-app .iv-delta {
  color: var(--good);
  font-weight: 700;
}
#iv-app .iv-x,
#iv-app .iv-dl {
  margin-left: auto;
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
#iv-app .iv-x:hover {
  color: var(--bad);
  background: var(--card);
  border-color: var(--border);
}
#iv-app .iv-dl:hover {
  color: var(--accent);
  background: var(--card);
  border-color: var(--border);
}
#iv-app .iv-x:focus-visible,
#iv-app .iv-dl:focus-visible,
#iv-app .iv-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#iv-app .iv-link {
  background: none;
  border: 0;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#iv-app .iv-link:hover {
  background: var(--card);
}
#iv-app .iv-res-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

/* ---------- panel pengaturan ---------- */
#iv-app .iv-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  position: sticky;
  top: 84px;
}
@media (max-width: 900px) {
  #iv-app .iv-side {
    position: static;
  }
}
#iv-app .iv-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#iv-app .iv-formats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
#iv-app .iv-fmt {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
#iv-app .iv-fmt b {
  font-size: 0.88rem;
}
#iv-app .iv-fmt span {
  font-size: 0.7rem;
  color: var(--muted);
}
#iv-app .iv-fmt:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
#iv-app .iv-fmt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
#iv-app .iv-fmt:has(input:checked) span {
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
}
#iv-app .iv-fmt:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#iv-app .iv-fmt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
#iv-app .iv-qhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#iv-app .iv-qval {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
#iv-app .iv-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
#iv-app .iv-hint {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
}
#iv-app .iv-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84rem;
  cursor: pointer;
}
#iv-app .iv-check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  flex: none;
  cursor: pointer;
}
#iv-app .iv-check small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}
#iv-app .iv-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
#iv-app .iv-sum {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
#iv-app .iv-sum b {
  color: var(--text);
  font-weight: 700;
}
#iv-app .iv-cta {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
}
#iv-app .iv-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}
#iv-app .iv-note svg {
  flex: none;
  margin-top: 1px;
}

/* ---------- status ---------- */
#iv-app .iv-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
#iv-app .iv-status:empty {
  display: none;
}
#iv-app .iv-status.ok {
  color: var(--good);
}
#iv-app .iv-status.err {
  color: var(--bad);
}

/* ---------- state sibuk ---------- */
#iv-app.is-busy .iv-drop {
  opacity: 0.55;
  pointer-events: none;
}
#iv-app.is-busy .iv-x {
  opacity: 0.5;
  pointer-events: none;
}
#iv-app .iv-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

#iv-app .iv-res-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tooltip badge di header tool: anchor kanan supaya tidak menambah lebar
   halaman pada viewport sempit (bug overflow yang sama ada di tool lain). */
.tool-layout:has(#iv-app) .proc-tip-bubble {
  left: auto;
  right: -9px;
}
.tool-layout:has(#iv-app) .proc-tip-bubble::after {
  left: auto;
  right: 11px;
}
