/* Inline name controls must not inherit the toolbar's 34/44px button height. */
#adjIptcDescription .iptc-player-pill {
  appearance: none; -webkit-appearance: none; display: inline;
  min-height: 0; min-width: 0; height: auto; width: auto;
  padding: 0 3px; margin: 0; border: 0; border-radius: 3px;
  background: rgba(148, 163, 184, .14); color: inherit;
  font: inherit; line-height: inherit; letter-spacing: inherit;
  text-transform: none; text-align: inherit; vertical-align: baseline;
  white-space: normal; box-shadow: none; cursor: pointer;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
#adjIptcDescription .iptc-player-pill:hover,
#adjIptcDescription .iptc-player-pill[aria-expanded="true"] {
  background: rgba(148, 163, 184, .26); color: inherit;
}
.iptc-face-card:hover {
  background: var(--bg-panel); border-color: var(--text-muted);
}
#adjIptcDescription .iptc-player-pill:focus-visible,
.iptc-face-card:focus-visible, .iptc-face-menu button:focus-visible {
  outline: 2px solid var(--accent, #397ada); outline-offset: 2px;
}
.iptc-face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; font-size: 12px; color: var(--text-muted); }
.iptc-face-card {
  min-width: 0; padding: 5px; border: 1px solid var(--border-subtle); border-radius: 9px;
  background: var(--bg-input); color: var(--text); font: inherit; font-size: 11px; cursor: pointer;
}
.iptc-face-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; background: var(--bg-panel); }
.iptc-face-card img[hidden] { display: none; }
.iptc-face-card span { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.iptc-face-card.is-ignored { opacity: .65; }
.iptc-face-menu {
  position: fixed; z-index: 100100; box-sizing: border-box; width: min(290px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px); overflow-y: auto; padding: 12px; border-radius: 12px;
  background: var(--bg-panel, #202b3d); color: var(--text, #edf2f8);
  border: 1px solid var(--border-subtle, #475569); box-shadow: 0 12px 36px #0006;
  font-family: inherit; font-size: 12px;
}
.iptc-face-menu strong { display: block; padding: 2px 25px 12px 0; overflow-wrap: anywhere; }
.iptc-face-menu button { color: inherit; font: inherit; cursor: pointer; }
.iptc-face-menu-close { width: 28px; height: 28px; padding: 0; line-height: 1; position: absolute; right: 8px; top: 6px; background: none; border: 0; font-size: 22px !important; }
.iptc-face-visibility {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px; margin: 0 0 8px; border: 1px solid var(--border-subtle);
  border-radius: 7px; background: var(--bg-input); cursor: pointer;
}
.iptc-face-visibility input {
  appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 40px;
  width: 40px; height: 23px; margin: 0; border: 1px solid var(--border-subtle);
  border-radius: 999px; background: var(--bg-panel); cursor: pointer;
}
.iptc-face-visibility input::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--text); transition: transform .15s;
}
.iptc-face-visibility input:checked { background: var(--accent, #397ada); }
.iptc-face-visibility input:checked::after { transform: translateX(17px); }
.iptc-face-visibility input:focus-visible { outline: 2px solid var(--accent, #397ada); outline-offset: 3px; }
.iptc-face-visibility input:disabled { opacity: .5; cursor: wait; }
.iptc-face-action, .iptc-face-suggestion {
  display: block; width: 100%; text-align: left; padding: 9px; margin: 4px 0;
  background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 7px;
}
.iptc-face-menu button:hover { background: var(--bg-hover, #ffffff12); }
.iptc-face-menu button:disabled { opacity: .5; cursor: wait; }
.iptc-face-suggestions-title { margin: 12px 0 6px; color: var(--text-muted); font-size: 11px; }
.iptc-face-menu [role="status"]:not(:empty) { margin-top: 8px; }
.iptc-face-filter-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 12px; font-size: 11px; color: var(--text-muted); cursor: pointer; }
.iptc-face-filter-switch input { appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 36px; width: 36px; height: 21px; padding: 0; margin: 0; border-radius: 999px; border: 1px solid var(--border-subtle); background: var(--bg-input); cursor: pointer; }
.iptc-face-filter-switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.iptc-face-filter-switch input:checked { background: var(--accent, #397ada); }
.iptc-face-filter-switch input:checked::after { transform: translateX(15px); }
.iptc-face-filter-switch input:focus-visible { outline: 2px solid var(--accent, #397ada); outline-offset: 3px; }
@media (min-width: 701px) and (min-height: 621px) {
  .face-popup.face-popup-name-editor { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
}
/* The mobile faces tab shares the desktop controls, in a compact swipeable row. */
#workflowPanelFaces { display: none; }
@media (max-width: 768px), (max-width: 1024px) and (orientation: portrait) {
  #workflowSidebar #workflowPanelFaces.is-active { display: flex; flex-direction: column; gap: 6px; padding: 6px 4px; min-height: 0; max-height: 190px; }
  #workflowPanelFaces .iptc-face-filter-switch { flex-shrink: 0; justify-content: flex-start; gap: 10px; margin: 0; min-height: 28px; }
  #workflowPanelFaces .iptc-face-filter-switch input { flex-shrink: 0; }
  #workflowSidebar #mobileFaceThumbnails { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; overflow-y: auto; min-height: 0; padding: 2px 1px 5px; -webkit-overflow-scrolling: touch; }
  #workflowSidebar #mobileFaceThumbnails .iptc-face-card { flex: 0 0 80px; width: 80px; min-height: 0; padding: 4px; font-size: 11px; }
  #workflowSidebar #mobileFaceThumbnails .iptc-face-card img { width: 70px; height: 70px; }
  #workflowSidebar #mobileFaceThumbnails .iptc-face-card span { line-height: 1.25; }
}
