/* Shared by the modular and compatibility entries, including body-level dialogs. */
:is(.button, .text-button, .icon-button)[hidden] { display: none !important; }
:is(#view, #auth, #modalRoot, dialog, #toastRegion) a[href] {
  color: inherit;
  text-decoration: none;
}
:is(#view, #auth, #modalRoot, dialog, #toastRegion) :is(button, a, summary) {
  letter-spacing: 0;
}
:is(#view, #auth, #modalRoot, dialog, #toastRegion) :is(button, a, summary):focus-visible {
  outline: 2px solid var(--navigation-accent);
  outline-offset: 3px;
}
:is(#view, #auth, #modalRoot, dialog, #toastRegion) .button {
  min-height: 44px;
  padding: 9px 16px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}
:is(#view, #auth, #modalRoot, dialog, #toastRegion) .button.primary {
  color: var(--opal-on-action);
}
:is(#view, #auth, #modalRoot, dialog, #toastRegion) .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-decoration: none;
}
:is(#view, #auth, #modalRoot, dialog, #toastRegion) .text-button:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--navigation-accent);
  background: var(--soft);
}
:is(#view, #auth, #modalRoot, dialog, #toastRegion) .text-button.danger { color: var(--danger); }
:is(#view, #auth, #modalRoot, dialog, #toastRegion) .text-button.danger:hover:not(:disabled) {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}
:is(#view, #auth, #modalRoot, dialog, #toastRegion) .text-button:disabled { opacity: .55; cursor: not-allowed; }
:is(#view, #auth, #modalRoot, dialog, #toastRegion) :is(.button, .text-button) svg {
  width: 18px;
  height: 18px;
  flex: none;
}
#view .source-file-preview > .text-button { width: 44px; min-width: 44px; padding: 0; }

/* Confirmation dialogs use the same action rhythm at every viewport. */
dialog .result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
dialog .result-actions > :is(.button, .text-button) {
  width: 100%;
  min-width: 0;
}

/* Disclosures remain native details/summary, with one visible control treatment. */
#view details > summary {
  position: relative;
  min-height: 44px;
  padding: 11px 36px 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  list-style: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}
#view details > summary::-webkit-details-marker { display: none; }
#view details > summary::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
#view details[open] > summary { background: var(--soft); border-color: var(--line2); color: var(--ink); }
#view details[open] > summary::after { transform: rotate(45deg); top: 15px; }
#view details > summary:hover { border-color: var(--navigation-accent); }
#view .image-tuning { padding: 10px 0 0; border-top: 0; }
#view .image-tuning .field { margin-top: 12px; }
#view .image-tuning textarea {
  width: 100%;
  min-height: 90px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}
#view .advanced-entry .account-chevron { display: none; }
#view .source-book-materials summary small { color: var(--muted); font-size: 12px; font-weight: 400; }

/* All image result renderers use the same action row, including failed items. */
#view .gallery-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
#view .gallery-actions > :is(a, button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-decoration: none;
}
#view .gallery-actions > :is(a, button):hover:not(:disabled) { border-color: var(--navigation-accent); background: var(--soft); }
#view .gallery-actions > button:disabled { opacity: .55; cursor: not-allowed; }
#view .gallery-actions > [data-move-image] { width: 44px; height: 44px; padding: 0; flex: 0 0 44px; }
#view .gallery-actions .image-open-action.primary { background: var(--navigation-accent); border-color: transparent; color: var(--opal-on-action); }
#view .gallery-actions .image-open-action.primary:hover { background: var(--navigation-accent); filter: brightness(.97); }
#view .result-gallery figcaption { flex-wrap: wrap; align-items: flex-start; }
#view .result-gallery .image-save-hint { flex-basis: 100%; }
#view .video-delivery a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 13px;
  justify-content: center;
  background: #071a20;
  color: #f0f4fb;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
#view .video-delivery a:hover { background: #122e38; }
#view .video-delivery a:focus-visible { outline-color: #f0f4fb; outline-offset: -3px; }
