/* Focused controls shared by the Max Headroom and AI background editors. */
.mh-ed-presets{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin:0 0 14px;
}
.mh-ed-presets .catchip{
  min-height:38px;
  padding:8px 10px;
  font-size:13px;
  line-height:1.2;
  text-align:center;
}
.mh-ed-advanced{
  margin:2px 0 0;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--card);
  overflow:hidden;
}
.mh-ed-advanced > summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 12px;
  color:var(--text);
  font-size:13px;
  font-weight:700;
  list-style:none;
  cursor:pointer;
  user-select:none;
}
.mh-ed-advanced > summary::-webkit-details-marker{display:none;}
.mh-ed-advanced > summary::after{
  content:"▸";
  color:var(--muted);
  font-size:12px;
  transition:transform .15s ease;
}
.mh-ed-advanced[open] > summary{
  border-bottom:1px solid var(--border);
}
.mh-ed-advanced[open] > summary::after{transform:rotate(90deg);}
.mh-ed-advanced .mh-ed-layer-cards{padding:10px 10px 0;}

.ai-bg-field{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin:0 0 12px;
}
.ai-bg-field label{
  color:var(--text);
  font-size:13px;
  font-weight:700;
}
.ai-bg-field textarea,
.ai-bg-field input{
  width:100%;
  box-sizing:border-box;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  background:var(--input-bg);
  color:var(--text);
  font:inherit;
}
.ai-bg-field textarea{
  min-height:78px;
  resize:vertical;
  line-height:1.4;
}
.ai-bg-field textarea:focus,
.ai-bg-field input:focus{
  border-color:var(--blue);
  outline:2px solid color-mix(in srgb,var(--blue) 22%,transparent);
  outline-offset:1px;
}
.ai-bg-name{margin-top:12px;}
.ai-bg-chips{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:0 0 14px;
}
.ai-bg-chips .catchip{
  padding:6px 9px;
  font-size:12.5px;
}
.ai-bg-preview-wrap{margin-top:2px;}
.ai-bg-preview{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:180px;
}
.ai-bg-preview img{
  display:none;
  width:100%;
  height:100%;
  object-fit:cover;
}
.ai-bg-preview-msg{
  padding:24px;
  text-align:center;
  font-size:14px;
}
.ai-bg-animate{
  display:flex;
  align-items:center;
  gap:8px;
  margin:2px 0 4px;
  font-size:14px;
  cursor:pointer;
}
.ai-bg-animate input{
  width:18px;
  height:18px;
  accent-color:var(--blue);
}
.ai-bg-actions{
  flex-wrap:wrap;
  gap:8px;
  z-index:2;
}
.ai-bg-actions .btn{flex:1 1 calc(50% - 8px);}
.ai-bg-actions .btn:disabled{
  cursor:not-allowed;
  opacity:.48;
}

@media (max-width:420px){
  .mh-ed-presets{grid-template-columns:1fr;}
}
