/* «Mis archivos» and the cloud: the "Trae archivos desde tu nube" band, the
   progress list, the file picker and the "Guardar una copia", "Enviar por
   email" and "Enviar a firma" dialogs (cloudFilesUI.js). Every rule is scoped under #userFilesSelectModal: the
   Tailwind preflight resets button fills, `form button`, `input`, `img` and
   the headings and paragraphs of style.css carry !important values. */

#userFilesSelectModal {
  --mfc-surface: #ffffff;
  --mfc-soft: #f4f7fc;
  --mfc-softer: #f9fbfe;
  --mfc-text: #182235;
  --mfc-muted: #556074;
  --mfc-border: #d8e0ec;
  --mfc-border-strong: #b9c6da;
  --mfc-accent: #075fc7;
  --mfc-accent-hover: #054fa6;
  --mfc-accent-soft: #e8f1fd;
  --mfc-accent-text: #ffffff;
  --mfc-ok: #146c3c;
  --mfc-ok-soft: #e4f4ea;
  --mfc-warn: #8a4a00;
  --mfc-warn-soft: #fff4e0;
  --mfc-danger: #b3261e;
  --mfc-danger-soft: #fdecea;
  --mfc-focus: 0 0 0 3px rgba(7, 95, 199, 0.28);
  --mfc-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 8px rgba(15, 23, 42, 0.04);
  --mfc-radius: 12px;
  /* The font of «Mis archivos» (Bootstrap's system font stack). */
  --mfc-font: var(--bs-body-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif);
}

body:is(.darkmode, .mezenta, .purple, .dark-greeny, .light-greeny, .red-dark, .blue-green-gradient, .pink-purple-gradient) #userFilesSelectModal {
  --mfc-surface: #182132;
  --mfc-soft: #222d41;
  --mfc-softer: #1d2738;
  --mfc-text: #f8fafc;
  --mfc-muted: #c3cddc;
  --mfc-border: #3a4860;
  --mfc-border-strong: #52617b;
  --mfc-accent: #7db4ff;
  --mfc-accent-hover: #a4ccff;
  --mfc-accent-soft: #1f3354;
  --mfc-accent-text: #071a33;
  --mfc-ok: #7fdca4;
  --mfc-ok-soft: #173826;
  --mfc-warn: #ffc876;
  --mfc-warn-soft: #3d2c10;
  --mfc-danger: #ff9d94;
  --mfc-danger-soft: #42201d;
  --mfc-focus: 0 0 0 3px rgba(125, 180, 255, 0.4);
  --mfc-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

#userFilesSelectModal .mfc-slot[hidden],
#userFilesSelectModal .mfc-dialog [hidden] {
  display: none !important;
}

#userFilesSelectModal .mfc-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- shared bits */

#userFilesSelectModal .mfc-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4em;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  background: #ffc107;
  color: #3d2a00;
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.01em;
  vertical-align: 0.15em;
}

#userFilesSelectModal .mfc-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent !important;
  color: var(--mfc-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-link:hover {
  color: var(--mfc-accent-hover);
}

#userFilesSelectModal .mfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 14px/1.2 var(--mfc-font);
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#userFilesSelectModal .mfc-btn--small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 8px;
}

#userFilesSelectModal .mfc-btn--primary {
  background: var(--mfc-accent) !important;
  border-color: var(--mfc-accent);
  color: var(--mfc-accent-text) !important;
}

#userFilesSelectModal .mfc-btn--primary:hover:not(:disabled) {
  background: var(--mfc-accent-hover) !important;
  border-color: var(--mfc-accent-hover);
}

#userFilesSelectModal .mfc-btn--ghost {
  background: transparent !important;
  border-color: var(--mfc-border);
  color: var(--mfc-text) !important;
}

#userFilesSelectModal .mfc-btn--ghost:hover:not(:disabled) {
  background: var(--mfc-soft) !important;
}

#userFilesSelectModal .mfc-btn--soft {
  background: var(--mfc-accent-soft) !important;
  border-color: transparent;
  color: var(--mfc-accent) !important;
}

#userFilesSelectModal .mfc-btn--soft:hover:not(:disabled) {
  border-color: var(--mfc-accent);
}

#userFilesSelectModal .mfc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#userFilesSelectModal .mfc-btn:focus-visible,
#userFilesSelectModal .mfc-link:focus-visible,
#userFilesSelectModal .mfc-icon-btn:focus-visible,
#userFilesSelectModal .mfc-shortcut:focus-visible,
#userFilesSelectModal .mfc-source:focus-visible,
#userFilesSelectModal .mfc-row__versions:focus-visible,
#userFilesSelectModal .mfc-more-apps > summary:focus-visible,
#userFilesSelectModal .mfc-tab:focus-visible,
#userFilesSelectModal .mfc-row__button:focus-visible,
#userFilesSelectModal .mfc-crumbs button:focus-visible {
  outline: none;
  box-shadow: var(--mfc-focus);
}

#userFilesSelectModal .mfc-icon-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: var(--mfc-muted);
  font-size: 16px;
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-icon-btn:hover {
  background: var(--mfc-soft) !important;
  color: var(--mfc-text);
}

#userFilesSelectModal .mfc-icon-btn--small {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

/* -------------------------------------------------------------------- band */

/* Same column as the upload box below it (.downloadUI). */
#userFilesSelectModal .mfc-slot {
  width: 90%;
  max-width: 800px;
  margin: 0.6em auto 0.4em;
  padding: 0;
}

#userFilesSelectModal .mfc-slot + .mfc-slot {
  margin-top: 1em;
}

/* One compact row: whoever does not use apps keeps «Mis archivos» as it was. */
#userFilesSelectModal .mfc-band {
  font-size: 0.95em;
  color: var(--mfc-text);
  background: var(--mfc-surface);
  border: 1px solid var(--mfc-border);
  border-radius: var(--mfc-radius);
  padding: 0.85em 1em 0.8em;
  box-shadow: var(--mfc-shadow);
}

#userFilesSelectModal .mfc-band__main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6em 0.9em;
}

#userFilesSelectModal .mfc-band__icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 2.3em;
  height: 2.3em;
  border-radius: 10px;
  background: var(--mfc-accent-soft);
  color: var(--mfc-accent);
  font-size: 1.05em;
}

#userFilesSelectModal .mfc-band[data-mode="sync"] .mfc-band__icon {
  background: var(--mfc-warn-soft);
  color: var(--mfc-warn);
}

#userFilesSelectModal .mfc-band__copy {
  flex: 1 1 16em;
  min-width: 0;
}

#userFilesSelectModal .mfc-band__title {
  margin: 0 0 0.1em !important;
  font-size: 1.02em !important;
  font-weight: 700 !important;
  line-height: 1.3;
  color: var(--mfc-text);
}

#userFilesSelectModal .mfc-band__text {
  margin: 0 !important;
  color: var(--mfc-muted);
  font-size: 0.88em;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-band__action {
  flex: 0 0 auto;
}

#userFilesSelectModal .mfc-band__apps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45em 0.8em;
  margin-top: 0.7em;
  padding-left: calc(2.3em * 1.05 + 0.9em);
}

#userFilesSelectModal .mfc-band__apps:empty {
  display: none;
}

#userFilesSelectModal .mfc-shortcuts,
#userFilesSelectModal .mfc-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#userFilesSelectModal .mfc-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin: 0;
  padding: 0 11px 0 6px;
  border: 1px solid var(--mfc-border);
  border-radius: 999px;
  background: var(--mfc-surface) !important;
  color: var(--mfc-text);
  font: 600 13px/1 var(--mfc-font);
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

#userFilesSelectModal .mfc-shortcut:hover {
  border-color: var(--mfc-accent);
  background: var(--mfc-accent-soft) !important;
}

#userFilesSelectModal .mfc-shortcut img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-logos li {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--mfc-soft);
}

#userFilesSelectModal .mfc-logos img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-band:is([data-mode="offer"], [data-mode="sync"]) .mfc-logos img {
  filter: grayscale(0.35);
  opacity: 0.85;
}

#userFilesSelectModal .mfc-band__none {
  flex: 1 1 14em;
  margin: 0 !important;
  color: var(--mfc-muted);
  font-size: 0.82em;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-band__foot {
  margin: 0.6em 0 0 !important;
  padding-left: calc(2.3em * 1.05 + 0.9em);
  color: var(--mfc-muted);
  font-size: 0.8em;
  line-height: 1.5;
}

#userFilesSelectModal .mfc-band__foot .anticon {
  margin-right: 0.3em;
  color: var(--mfc-accent);
}

#userFilesSelectModal .mfc-band__foot .mfc-link {
  margin-left: 0.25em;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-tone--ok {
  color: var(--mfc-ok);
}

#userFilesSelectModal .mfc-tone--warn {
  color: var(--mfc-warn);
  font-weight: 600;
}

/* ------------------------------------------------------------ progress list */

#userFilesSelectModal .mfc-tray {
  font-size: 0.95em;
  color: var(--mfc-text);
  background: var(--mfc-surface);
  border: 1px solid var(--mfc-border);
  border-radius: var(--mfc-radius);
  box-shadow: var(--mfc-shadow);
  overflow: hidden;
}

#userFilesSelectModal .mfc-tray__head {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.85em 1em;
  background: var(--mfc-accent-soft);
  border-bottom: 1px solid var(--mfc-border);
}

#userFilesSelectModal .mfc-tray.is-finished .mfc-tray__head {
  background: var(--mfc-ok-soft);
}

#userFilesSelectModal .mfc-tray__icon {
  flex: 0 0 auto;
  color: var(--mfc-accent);
  font-size: 1.25em;
}

#userFilesSelectModal .mfc-tray:not(.is-finished) .mfc-tray__icon .anticon {
  animation: mfc-spin 1.6s linear infinite;
}

#userFilesSelectModal .mfc-tray.is-finished .mfc-tray__icon {
  color: var(--mfc-ok);
}

#userFilesSelectModal .mfc-tray__copy {
  flex: 1 1 auto;
  min-width: 0;
}

#userFilesSelectModal .mfc-tray__title {
  margin: 0 !important;
  font-size: 1em !important;
  font-weight: 700 !important;
  line-height: 1.35;
  outline: none;
}

#userFilesSelectModal .mfc-tray__hint {
  margin: 0.1em 0 0 !important;
  color: var(--mfc-muted);
  font-size: 0.84em;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-tray__list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 22em;
  overflow-y: auto;
}

#userFilesSelectModal .mfc-tray__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em 0.75em;
  padding: 0.75em 1em;
  border-top: 1px solid var(--mfc-border);
}

#userFilesSelectModal .mfc-tray__row:first-child {
  border-top: 0;
}

#userFilesSelectModal .mfc-receipt-detail:not(:empty) {
  flex-basis: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

#userFilesSelectModal .mfc-tray__logo {
  flex: 0 0 auto;
  width: 1.75em;
  height: 1.75em;
  object-fit: contain;
}

#userFilesSelectModal .mfc-tray__main {
  flex: 1 1 8em;
  min-width: 0;
}

/* A name is the only thing that tells two rows apart: it wraps instead of being cut. */
#userFilesSelectModal .mfc-tray__name {
  margin: 0 !important;
  font-weight: 600;
  font-size: 0.95em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* A row with a text button (Abrir, Traer la versión actual, Reintentar) asks for
   room first; when the row is too narrow the buttons drop under the name and status. */
#userFilesSelectModal .mfc-tray__row:has(.mfc-tray__actions .mfc-btn) .mfc-tray__main {
  flex-basis: 16em;
}

#userFilesSelectModal .mfc-tray__status {
  margin: 0.1em 0 0 !important;
  color: var(--mfc-muted);
  font-size: 0.84em;
  line-height: 1.4;
}

#userFilesSelectModal .mfc-tray__row.is-done .mfc-tray__status {
  color: var(--mfc-ok);
}

#userFilesSelectModal .mfc-tray__row.is-failed .mfc-tray__status,
#userFilesSelectModal .mfc-tray__row.is-cancelled .mfc-tray__status {
  color: var(--mfc-danger);
}

#userFilesSelectModal .mfc-tray__row.is-changed .mfc-tray__status {
  color: var(--mfc-warn);
}

#userFilesSelectModal .mfc-tray__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-left: auto;
}

#userFilesSelectModal .mfc-progress {
  position: relative;
  height: 6px;
  margin-top: 0.5em;
  border-radius: 999px;
  background: var(--mfc-soft);
  overflow: hidden;
}

#userFilesSelectModal .mfc-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mfc-accent);
  transition: width 0.4s ease;
}

#userFilesSelectModal .mfc-progress.is-indeterminate > span {
  width: 35%;
  animation: mfc-indeterminate 1.4s ease-in-out infinite;
}

@keyframes mfc-indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}

@keyframes mfc-spin {
  to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------- dialogs */

#userFilesSelectModal .mfc-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--mfc-text);
  background: var(--mfc-surface);
  box-shadow: 0 24px 64px rgba(15, 30, 55, 0.3);
  font: 400 15px/1.5 var(--mfc-font);
  overflow: hidden;
}

#userFilesSelectModal .mfc-dialog.mfc-picker {
  /* A fixed height: moving between folders or apps never resizes the window. */
  width: min(980px, calc(100vw - 32px));
  height: min(700px, calc(100dvh - 48px));
}

#userFilesSelectModal .mfc-dialog.mfc-picker[data-mode="folder"] {
  width: min(720px, calc(100vw - 32px));
  height: min(640px, calc(100dvh - 48px));
}

#userFilesSelectModal .mfc-dialog.mfc-export {
  width: min(580px, calc(100vw - 32px));
}

#userFilesSelectModal .mfc-dialog.mfc-email {
  width: min(600px, calc(100vw - 32px));
  /* A whole email, ending with what the Abogado Virtual offers, fits on a large screen. */
  max-height: min(900px, calc(100dvh - 48px));
}

#userFilesSelectModal .mfc-dialog.mfc-sign {
  width: min(620px, calc(100vw - 32px));
}

#userFilesSelectModal .mfc-dialog[open] {
  display: flex;
}

#userFilesSelectModal .mfc-dialog::backdrop {
  background: rgba(10, 20, 40, 0.45);
}

#userFilesSelectModal .mfc-dialog__shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  max-height: inherit;
}

#userFilesSelectModal .mfc-picker .mfc-dialog__shell {
  height: 100%;
}

#userFilesSelectModal .mfc-dialog__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px 20px;
  border-bottom: 1px solid var(--mfc-border);
}

#userFilesSelectModal .mfc-dialog__logo {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-dialog__glyph {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--mfc-accent-soft);
  color: var(--mfc-accent);
  font-size: 18px;
}

#userFilesSelectModal .mfc-dialog__titles {
  flex: 1 1 auto;
  min-width: 0;
}

#userFilesSelectModal .mfc-dialog__title {
  margin: 0 !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.3;
  color: var(--mfc-text);
}

#userFilesSelectModal .mfc-dialog__account {
  margin: 2px 0 0 !important;
  overflow: hidden;
  color: var(--mfc-muted);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-dialog__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--mfc-border);
  background: var(--mfc-softer);
}

#userFilesSelectModal .mfc-foot__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 260px;
  min-width: 0;
  font-size: 13.5px;
}

#userFilesSelectModal .mfc-foot__count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  color: var(--mfc-text);
  font-weight: 600;
}

#userFilesSelectModal .mfc-foot__count .anticon {
  color: var(--mfc-accent);
}

#userFilesSelectModal .mfc-foot__limit {
  color: var(--mfc-warn);
  font-size: 13px;
}

#userFilesSelectModal .mfc-foot__error {
  margin: 0 !important;
  color: var(--mfc-danger);
  font-size: 13px;
  font-weight: 600;
}

#userFilesSelectModal .mfc-foot__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

#userFilesSelectModal .mfc-speakers {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
}

#userFilesSelectModal .mfc-speakers > span {
  display: flex;
  flex-direction: column;
}

#userFilesSelectModal .mfc-speakers__title {
  color: var(--mfc-text);
  font-weight: 600;
}

#userFilesSelectModal .mfc-speakers__hint {
  color: var(--mfc-muted);
  font-size: 12.5px;
}

/* Checkboxes and radios look the same in every theme (style.css styles inputs). */
#userFilesSelectModal .mfc-dialog input[type="checkbox"] {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  padding: 0;
  border: 2px solid var(--mfc-border-strong);
  border-radius: 6px;
  background: var(--mfc-surface) no-repeat center / 14px 14px;
  cursor: pointer;
  font-size: 0;
}

#userFilesSelectModal .mfc-dialog input[type="checkbox"]:checked {
  border-color: var(--mfc-accent);
  background-color: var(--mfc-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}

#userFilesSelectModal .mfc-dialog input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#userFilesSelectModal .mfc-dialog input[type="checkbox"]:focus-visible,
#userFilesSelectModal .mfc-dialog input[type="radio"]:focus-visible + * {
  outline: none;
  box-shadow: var(--mfc-focus);
}

/* ------------------------------------------------------------------ picker */

#userFilesSelectModal .mfc-picker__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 20px 10px;
}

#userFilesSelectModal .mfc-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 10px;
  background: var(--mfc-soft);
}

#userFilesSelectModal .mfc-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent !important;
  color: var(--mfc-muted);
  font: 600 13.5px/1 var(--mfc-font);
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-tab[aria-selected="true"] {
  background: var(--mfc-surface) !important;
  color: var(--mfc-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

#userFilesSelectModal .mfc-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: 0;
}

#userFilesSelectModal .mfc-search > .anticon {
  position: absolute;
  left: 12px;
  color: var(--mfc-muted);
  font-size: 15px;
  pointer-events: none;
}

#userFilesSelectModal .mfc-search__input,
#userFilesSelectModal .mfc-input {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--mfc-border);
  border-radius: 10px;
  background: var(--mfc-surface);
  color: var(--mfc-text);
  font: 400 14.5px/1.2 var(--mfc-font);
  box-shadow: none;
}

#userFilesSelectModal .mfc-search__input {
  padding-left: 36px;
  padding-right: 36px;
}

#userFilesSelectModal .mfc-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

#userFilesSelectModal .mfc-search__input:focus,
#userFilesSelectModal .mfc-input:focus {
  outline: none;
  border-color: var(--mfc-accent);
  box-shadow: var(--mfc-focus);
}

#userFilesSelectModal .mfc-search__clear {
  position: absolute;
  right: 4px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: var(--mfc-muted);
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 20px 8px;
}

#userFilesSelectModal .mfc-picker[data-mode="folder"] .mfc-crumbs {
  padding-top: 12px;
}

#userFilesSelectModal .mfc-crumbs__back {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--mfc-border);
  border-radius: 8px;
  background: var(--mfc-surface) !important;
  color: var(--mfc-text);
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-crumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
}

#userFilesSelectModal .mfc-crumbs__item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

#userFilesSelectModal .mfc-crumbs__item + .mfc-crumbs__item::before {
  content: '›';
  margin: 0 4px;
  color: var(--mfc-muted);
}

#userFilesSelectModal .mfc-crumbs__item > span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-crumbs__link {
  max-width: 14em;
  overflow: hidden;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent !important;
  color: var(--mfc-accent);
  font: 600 13.5px/1.3 var(--mfc-font);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-crumbs__label {
  margin: 0 !important;
  font-size: 13.5px;
  font-weight: 700;
}

#userFilesSelectModal .mfc-picker__notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 20px 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--mfc-warn-soft);
  color: var(--mfc-warn);
  font-size: 13px;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-picker__body {
  flex: 1 1 auto;
  min-height: 260px;
  overflow-y: auto;
  padding: 0 12px 12px;
  outline: none;
  overscroll-behavior: contain;
}

#userFilesSelectModal .mfc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#userFilesSelectModal .mfc-row {
  margin: 0;
  border-radius: 10px;
}

#userFilesSelectModal .mfc-row + .mfc-row {
  margin-top: 2px;
}

#userFilesSelectModal .mfc-row__label,
#userFilesSelectModal .mfc-row__button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent !important;
  color: var(--mfc-text);
  font: inherit;
  font-weight: 400;
  text-align: left;
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-row__label:hover,
#userFilesSelectModal .mfc-row__button:hover {
  background: var(--mfc-soft) !important;
}

#userFilesSelectModal .mfc-row.is-selected .mfc-row__label {
  background: var(--mfc-accent-soft) !important;
  border-color: color-mix(in srgb, var(--mfc-accent) 35%, transparent);
}

#userFilesSelectModal .mfc-row.is-unavailable .mfc-row__label {
  cursor: default;
}

#userFilesSelectModal .mfc-row.is-unavailable .mfc-row__label:hover {
  background: transparent !important;
}

#userFilesSelectModal .mfc-row.is-unavailable .mfc-row__name,
#userFilesSelectModal .mfc-row.is-unavailable .mfc-row__icon {
  opacity: 0.6;
}

#userFilesSelectModal .mfc-row__icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--mfc-soft);
  color: var(--mfc-muted);
  font-size: 18px;
}

#userFilesSelectModal .mfc-type--folder { color: #c48a06; background: #fff5d9; }
#userFilesSelectModal .mfc-type--pdf { color: #c62828; background: #fdecec; }
#userFilesSelectModal .mfc-type--word,
#userFilesSelectModal .mfc-type--google_doc { color: #1f5fbf; background: #e7f0fd; }
#userFilesSelectModal .mfc-type--sheet,
#userFilesSelectModal .mfc-type--google_sheet { color: #13804b; background: #e3f5ea; }
#userFilesSelectModal .mfc-type--slides,
#userFilesSelectModal .mfc-type--google_slides { color: #c45400; background: #fff0e3; }
#userFilesSelectModal .mfc-type--image { color: #7b3fbf; background: #f2eafc; }
#userFilesSelectModal .mfc-type--audio { color: #4b4fc7; background: #ebecfd; }
#userFilesSelectModal .mfc-type--video { color: #c2185b; background: #fde8f0; }

body:is(.darkmode, .mezenta, .purple, .dark-greeny, .light-greeny, .red-dark, .blue-green-gradient, .pink-purple-gradient) #userFilesSelectModal .mfc-row__icon {
  background: var(--mfc-soft);
  filter: saturate(0.9) brightness(1.25);
}

#userFilesSelectModal .mfc-row__main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

/* Long legal file names get two lines before they are cut. */
#userFilesSelectModal .mfc-row__name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

#userFilesSelectModal .mfc-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  color: var(--mfc-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-row__note {
  flex-basis: 100%;
  color: var(--mfc-accent);
}

#userFilesSelectModal .mfc-row__reason {
  flex-basis: 100%;
  color: var(--mfc-warn);
}

#userFilesSelectModal .mfc-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--mfc-soft);
  color: var(--mfc-muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
}

#userFilesSelectModal .mfc-row__chevron {
  flex: 0 0 auto;
  color: var(--mfc-muted);
  font-size: 13px;
}

#userFilesSelectModal .mfc-more {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

#userFilesSelectModal .mfc-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 240px;
  padding: 24px 16px;
  text-align: center;
}

#userFilesSelectModal .mfc-state > .anticon {
  margin-bottom: 4px;
  color: var(--mfc-muted);
  font-size: 34px;
}

#userFilesSelectModal .mfc-state--warn > .anticon {
  color: var(--mfc-warn);
}

#userFilesSelectModal .mfc-state--error > .anticon {
  color: var(--mfc-danger);
}

#userFilesSelectModal .mfc-state__title {
  margin: 0 !important;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

#userFilesSelectModal .mfc-state__text {
  max-width: 34em;
  margin: 0 0 8px !important;
  color: var(--mfc-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

#userFilesSelectModal .mfc-skeleton {
  padding: 4px 0;
}

#userFilesSelectModal .mfc-skeleton__row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 8px 10px;
}

#userFilesSelectModal .mfc-skeleton__row span {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--mfc-soft) 25%, var(--mfc-softer) 50%, var(--mfc-soft) 75%);
  background-size: 200% 100%;
  animation: mfc-shimmer 1.3s ease-in-out infinite;
}

#userFilesSelectModal .mfc-skeleton__row span:first-child {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}

#userFilesSelectModal .mfc-skeleton__row span:last-child {
  width: 55%;
  height: 14px;
}

#userFilesSelectModal .mfc-skeleton__row:nth-child(2n) span:last-child {
  width: 40%;
}

#userFilesSelectModal .mfc-skeleton__label {
  margin: 8px 0 0 !important;
  color: var(--mfc-muted);
  font-size: 13px;
  text-align: center;
}

@keyframes mfc-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ------------------------------------------------------------------ export */

#userFilesSelectModal .mfc-export__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 14px;
}

#userFilesSelectModal .mfc-field {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  min-width: 0;
}

#userFilesSelectModal .mfc-field__label {
  display: block;
  float: none;
  width: auto;
  margin: 0 0 6px;
  padding: 0;
  color: var(--mfc-text);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
}

#userFilesSelectModal .mfc-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

#userFilesSelectModal .mfc-choice,
#userFilesSelectModal .mfc-format {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--mfc-border);
  border-radius: 10px;
  background: var(--mfc-surface);
  cursor: pointer;
  font-weight: 400;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

#userFilesSelectModal .mfc-choice:hover,
#userFilesSelectModal .mfc-format:hover {
  border-color: var(--mfc-border-strong);
}

#userFilesSelectModal .mfc-choice.is-selected,
#userFilesSelectModal .mfc-format.is-selected {
  border-color: var(--mfc-accent);
  background: var(--mfc-accent-soft);
  box-shadow: inset 0 0 0 1px var(--mfc-accent);
}

#userFilesSelectModal .mfc-choice input,
#userFilesSelectModal .mfc-format input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#userFilesSelectModal .mfc-choice:focus-within,
#userFilesSelectModal .mfc-format:focus-within {
  box-shadow: var(--mfc-focus);
}

#userFilesSelectModal .mfc-choice img {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-choice__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#userFilesSelectModal .mfc-choice__name {
  font-weight: 600;
  font-size: 14px;
}

#userFilesSelectModal .mfc-choice__status {
  overflow: hidden;
  color: var(--mfc-muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-formats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 8px;
}

#userFilesSelectModal .mfc-format {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

#userFilesSelectModal .mfc-format__name {
  font-weight: 600;
  font-size: 14px;
}

#userFilesSelectModal .mfc-format__hint {
  color: var(--mfc-muted);
  font-size: 12px;
  line-height: 1.4;
}

#userFilesSelectModal .mfc-folder-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--mfc-border);
  border-radius: 10px;
}

#userFilesSelectModal .mfc-folder-pick__name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 14px;
}

#userFilesSelectModal .mfc-folder-pick__name .anticon {
  color: #c48a06;
}

#userFilesSelectModal .mfc-folder-pick__name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-export__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0 !important;
  color: var(--mfc-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

#userFilesSelectModal .mfc-inline-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--mfc-soft);
  font-size: 13.5px;
}

#userFilesSelectModal .mfc-inline-note > span {
  flex: 1 1 200px;
}

#userFilesSelectModal .mfc-inline-note--warn {
  background: var(--mfc-warn-soft);
  color: var(--mfc-warn);
}

#userFilesSelectModal .mfc-export__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 8px 6px;
  text-align: center;
}

#userFilesSelectModal .mfc-export__done-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--mfc-ok-soft);
  color: var(--mfc-ok);
  font-size: 24px;
}

#userFilesSelectModal .mfc-export__done .mfc-btn {
  margin-top: 6px;
}


/* ------------------------------------------------- picker: apps and layout */

#userFilesSelectModal .mfc-picker__shell {
  container: mfc-picker / inline-size;
}

#userFilesSelectModal .mfc-picker__layout {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

#userFilesSelectModal .mfc-sources {
  flex: 0 0 244px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 10px 14px;
  border-right: 1px solid var(--mfc-border);
  background: var(--mfc-softer);
  overscroll-behavior: contain;
}

#userFilesSelectModal .mfc-sources__title {
  display: none;
}

#userFilesSelectModal .mfc-sources__group {
  margin: 10px 8px 6px !important;
  color: var(--mfc-muted);
  font-size: 11.5px !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

#userFilesSelectModal .mfc-sources__items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#userFilesSelectModal .mfc-source {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent !important;
  color: var(--mfc-text);
  font: 400 14px/1.3 var(--mfc-font);
  text-align: left;
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-source:hover {
  background: var(--mfc-soft) !important;
}

#userFilesSelectModal .mfc-source.is-current {
  border-color: var(--mfc-border);
  background: var(--mfc-surface) !important;
  box-shadow: inset 3px 0 0 var(--mfc-accent), var(--mfc-shadow);
}

#userFilesSelectModal .mfc-source__logo {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-source__text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

#userFilesSelectModal .mfc-source__name {
  font-weight: 600;
}

#userFilesSelectModal .mfc-source__status {
  overflow: hidden;
  color: var(--mfc-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-source__count {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--mfc-accent);
  color: var(--mfc-accent-text);
  font-size: 12px;
  font-weight: 700;
}

#userFilesSelectModal .mfc-source__chevron {
  display: none;
  color: var(--mfc-muted);
  font-size: 12px;
}

/* The end of the list of apps: the others work with the Abogado Virtual, and
   the regular upload needs no app. */
#userFilesSelectModal .mfc-sources__end {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 0;
  padding: 14px 4px 0;
  border-top: 1px solid var(--mfc-border);
  color: var(--mfc-muted);
  font: 400 12.5px/1.45 var(--mfc-font);
}

#userFilesSelectModal .mfc-sources__note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 4px;
}

#userFilesSelectModal .mfc-sources__note-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--mfc-accent-soft);
  color: var(--mfc-accent);
  font-size: 14px;
}

#userFilesSelectModal .mfc-sources__note-title {
  margin: 0 0 2px !important;
  color: var(--mfc-text);
  font-size: 13px !important;
  font-weight: 700;
  line-height: 1.35;
}

#userFilesSelectModal .mfc-sources__note-text {
  margin: 0 !important;
  font-size: 12.5px !important;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-sources__end strong {
  color: var(--mfc-text);
  font-weight: 700;
}

/* The regular upload, drawn like its drop zone: one button, no app. */
#userFilesSelectModal .mfc-sources__upload {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--mfc-border-strong);
  border-radius: 10px;
  background: var(--mfc-surface) !important;
  color: var(--mfc-text);
  font: 400 12.5px/1.4 var(--mfc-font);
  text-align: left;
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#userFilesSelectModal .mfc-sources__upload:hover {
  border-color: var(--mfc-accent);
  background: var(--mfc-accent-soft) !important;
}

#userFilesSelectModal .mfc-sources__upload:focus-visible {
  outline: none;
  border-color: var(--mfc-accent);
  box-shadow: var(--mfc-focus);
}

#userFilesSelectModal .mfc-sources__upload-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--mfc-accent-soft);
  color: var(--mfc-accent);
  font-size: 15px;
}

#userFilesSelectModal .mfc-sources__upload-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#userFilesSelectModal .mfc-sources__upload-label {
  color: var(--mfc-accent);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

#userFilesSelectModal .mfc-sources__upload-hint {
  color: var(--mfc-muted);
}

/* Where "Subir desde tu dispositivo" lands: the upload box, briefly outlined. */
#userFilesSelectModal .downloadUI {
  scroll-margin-top: 16px;
}

#userFilesSelectModal .downloadUI.mfc-upload-spot {
  border-radius: 14px;
  outline: 3px solid transparent;
  outline-offset: 4px;
  animation: mfc-upload-spot 2.4s ease-out 1;
}

@keyframes mfc-upload-spot {
  0%, 50% { outline-color: var(--mfc-accent); }
  100% { outline-color: transparent; }
}

#userFilesSelectModal .mfc-picker__main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

#userFilesSelectModal .mfc-source-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 0;
}

#userFilesSelectModal .mfc-source-head__logo {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-source-head__text {
  flex: 1 1 auto;
  min-width: 0;
}

#userFilesSelectModal .mfc-source-head__name {
  margin: 0 !important;
  font-size: 15px !important;
  font-weight: 700;
  line-height: 1.3;
}

#userFilesSelectModal .mfc-source-head__account {
  margin: 0 !important;
  overflow: hidden;
  color: var(--mfc-muted);
  font-size: 12.5px !important;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-source-head__change {
  display: none;
}

#userFilesSelectModal .mfc-picker__body--panel {
  display: flex;
}

#userFilesSelectModal .mfc-connect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 440px;
  margin: auto;
  padding: 28px 20px;
  text-align: center;
}

#userFilesSelectModal .mfc-connect__logo {
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-connect .mfc-btn {
  margin-top: 10px;
}

#userFilesSelectModal .mfc-picker__notice--info {
  background: var(--mfc-accent-soft);
  color: var(--mfc-text);
}

#userFilesSelectModal .mfc-picker__notice--info .anticon {
  color: var(--mfc-accent);
}

/* A narrow window lists the apps on their own screen ("Cambiar"). */
@container mfc-picker (max-width: 719.98px) {
  #userFilesSelectModal .mfc-sources {
    display: none;
    flex: 1 1 auto;
    padding: 6px 12px 16px;
    border-right: 0;
    background: var(--mfc-surface);
  }

  #userFilesSelectModal .mfc-picker__shell[data-sources="open"] .mfc-sources {
    display: block;
  }

  #userFilesSelectModal .mfc-picker__shell[data-sources="open"] .mfc-picker__main {
    display: none;
  }

  #userFilesSelectModal .mfc-sources__title {
    display: block;
    margin: 8px 8px 0 !important;
    font-size: 15px !important;
    font-weight: 700;
  }

  #userFilesSelectModal .mfc-source {
    min-height: 56px;
  }

  #userFilesSelectModal .mfc-source__chevron {
    display: inline-block;
  }

  #userFilesSelectModal .mfc-sources__end {
    margin-top: 18px;
    padding: 16px 8px 0;
    font-size: 13px;
  }

  #userFilesSelectModal .mfc-sources__note-text {
    font-size: 13px !important;
  }

  #userFilesSelectModal .mfc-sources__upload {
    min-height: 56px;
    padding: 10px 12px;
    font-size: 13px;
  }

  #userFilesSelectModal .mfc-source-head {
    padding: 10px 14px 0;
  }

  #userFilesSelectModal .mfc-source-head__change {
    display: inline-flex;
  }
}

/* ------------------------------------------ picker: messages and versions */

#userFilesSelectModal .mfc-type--message { color: #1f5fbf; background: #e7f0fd; }
#userFilesSelectModal .mfc-type--site,
#userFilesSelectModal .mfc-type--library { color: #036c70; background: #e0f4f4; }

#userFilesSelectModal .mfc-row--message.is-open > .mfc-row__button {
  background: var(--mfc-soft) !important;
}

#userFilesSelectModal .mfc-row--message .mfc-row__chevron {
  transition: transform 0.15s ease;
}

#userFilesSelectModal .mfc-row--message.is-open .mfc-row__chevron {
  transform: rotate(180deg);
}

#userFilesSelectModal .mfc-row__versions[aria-expanded="true"] {
  background: var(--mfc-accent-soft) !important;
}

#userFilesSelectModal .mfc-row__children {
  margin: 2px 0 8px 27px;
  padding-left: 10px;
  border-left: 2px solid var(--mfc-border);
}

#userFilesSelectModal .mfc-list--nested .mfc-row__label {
  min-height: 48px;
}

#userFilesSelectModal .mfc-children__note {
  margin: 8px 6px !important;
  color: var(--mfc-muted);
  font-size: 13px;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-children__note--error {
  color: var(--mfc-danger);
}

#userFilesSelectModal .mfc-children__note .mfc-link {
  margin-left: 0.35em;
}

#userFilesSelectModal .mfc-children__loading {
  padding: 4px 6px;
}

#userFilesSelectModal .mfc-row__versions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -6px 0 6px 82px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent !important;
  color: var(--mfc-accent);
  font: 600 12.5px/1.2 var(--mfc-font);
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-row__versions:hover {
  background: var(--mfc-accent-soft) !important;
}

#userFilesSelectModal .mfc-row--file.has-versions > .mfc-row__children {
  margin-left: 47px;
}

/* A narrow window keeps the opened messages and versions close to the edge. */
@container mfc-picker (max-width: 479.98px) {
  #userFilesSelectModal .mfc-row__children,
  #userFilesSelectModal .mfc-row--file.has-versions > .mfc-row__children {
    margin-left: 14px;
    padding-left: 4px;
  }

  #userFilesSelectModal .mfc-row__versions {
    margin-left: 48px;
  }
}

/* ------------------------------------------------- copy dialog: more apps */

#userFilesSelectModal .mfc-more-apps {
  margin-top: 10px;
}

#userFilesSelectModal .mfc-more-apps > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 2px;
  border-radius: 6px;
  color: var(--mfc-accent);
  font-size: 13.5px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

#userFilesSelectModal .mfc-more-apps > summary::-webkit-details-marker {
  display: none;
}

#userFilesSelectModal .mfc-more-apps > summary::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 4px 0 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

#userFilesSelectModal .mfc-more-apps[open] > summary::before {
  transform: translateY(-2px) rotate(45deg);
}

#userFilesSelectModal .mfc-more-apps__count {
  color: var(--mfc-muted);
  font-weight: 400;
}

#userFilesSelectModal .mfc-more-apps .mfc-choices {
  margin-top: 6px;
}

#userFilesSelectModal .mfc-folder-pick.is-empty .mfc-folder-pick__name {
  color: var(--mfc-muted);
}

/* ------------------------------------------------------ "Enviar a…" menu */

#userFilesSelectModal .mfc-menu {
  position: fixed;
  z-index: 1080;
  padding: 6px;
  border: 1px solid var(--mfc-border);
  border-radius: 12px;
  background: var(--mfc-surface);
  color: var(--mfc-text);
  box-shadow: 0 12px 32px rgba(15, 30, 55, 0.22);
  font: 400 14px/1.4 var(--mfc-font);
}

#userFilesSelectModal .mfc-menu[hidden] {
  display: none !important;
}

#userFilesSelectModal .mfc-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent !important;
  color: var(--mfc-text);
  font: inherit;
  text-align: left;
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}

#userFilesSelectModal .mfc-menu__item:hover,
#userFilesSelectModal .mfc-menu__item:focus-visible {
  outline: none;
  background: var(--mfc-soft) !important;
}

#userFilesSelectModal .mfc-menu__icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--mfc-accent-soft);
  color: var(--mfc-accent);
  font-size: 16px;
}

#userFilesSelectModal .mfc-menu__icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-menu__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#userFilesSelectModal .mfc-menu__label {
  font-weight: 600;
}

#userFilesSelectModal .mfc-menu__hint {
  color: var(--mfc-muted);
  font-size: 12.5px;
}

/* Below the actions: everything else is done with the Abogado Virtual. */
#userFilesSelectModal .mfc-menu__note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 0 !important;
  padding: 10px 10px 6px;
  border-top: 1px solid var(--mfc-border);
  color: var(--mfc-muted);
  font-size: 12.5px !important;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-menu__note-icon {
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  height: 20px;
  color: var(--mfc-accent);
  font-size: 15px;
}

#userFilesSelectModal .mfc-menu__note strong {
  color: var(--mfc-text);
  font-weight: 700;
}

/* --------------------------------------------------------- "Enviar a firma" */

#userFilesSelectModal .mfc-signers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#userFilesSelectModal .mfc-signer {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1.3fr) 30px;
  align-items: center;
  gap: 8px;
}

#userFilesSelectModal .mfc-signer--email-only {
  grid-template-columns: 24px minmax(0, 1fr) 30px;
}

#userFilesSelectModal .mfc-signer > .mfc-sign__error {
  grid-column: 2 / -1;
}

#userFilesSelectModal .mfc-signer__number {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mfc-soft);
  color: var(--mfc-muted);
  font-size: 12px;
  font-weight: 700;
}

#userFilesSelectModal .mfc-signer__spacer {
  width: 30px;
}

#userFilesSelectModal .mfc-signers__add {
  margin-top: 10px;
}

#userFilesSelectModal .mfc-textarea {
  height: auto;
  min-height: 78px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

/* «Enviar a firma»: the signature apps, one tile each. */
#userFilesSelectModal .mfc-sign-apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 10px;
}

#userFilesSelectModal .mfc-sign-app {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 16px 10px 12px;
  border: 1px solid var(--mfc-border);
  border-radius: var(--mfc-radius);
  background: var(--mfc-surface);
  color: var(--mfc-text);
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#userFilesSelectModal .mfc-sign-app:not(.is-selected):not(.is-locked):hover {
  border-color: var(--mfc-border-strong);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

#userFilesSelectModal .mfc-sign-app.is-selected {
  border-color: var(--mfc-accent);
  background: var(--mfc-accent-soft);
  box-shadow: inset 0 0 0 1px var(--mfc-accent);
}

#userFilesSelectModal .mfc-sign-app.is-locked {
  cursor: default;
}

#userFilesSelectModal .mfc-sign-app.is-locked:not(.is-selected) {
  opacity: 0.55;
}

#userFilesSelectModal .mfc-sign-app input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

#userFilesSelectModal .mfc-sign-app:focus-within {
  box-shadow: var(--mfc-focus);
}

#userFilesSelectModal .mfc-sign-app.is-selected:focus-within {
  box-shadow: inset 0 0 0 1px var(--mfc-accent), var(--mfc-focus);
}

/* The ring is for the keyboard; a click already shows the selection. */
#userFilesSelectModal .mfc-sign-app:focus-within:not(:has(input:focus-visible)) {
  box-shadow: none;
}

#userFilesSelectModal .mfc-sign-app.is-selected:focus-within:not(:has(input:focus-visible)) {
  box-shadow: inset 0 0 0 1px var(--mfc-accent);
}

#userFilesSelectModal .mfc-sign-app__check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--mfc-accent);
  color: var(--mfc-accent-text);
  font-size: 11px;
  line-height: 1;
}

#userFilesSelectModal .mfc-sign-app.is-selected .mfc-sign-app__check {
  display: flex;
}

/* The logos come on a white square: a white tile keeps them crisp in dark themes too. */
#userFilesSelectModal .mfc-sign-app__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.08);
}

#userFilesSelectModal .mfc-sign-app__logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-sign-app__name,
#userFilesSelectModal .mfc-sign-app__status {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-sign-app__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

#userFilesSelectModal .mfc-sign-app__status {
  color: var(--mfc-muted);
  font-size: 12px;
  line-height: 1.35;
}

#userFilesSelectModal .mfc-sign-app__status--ok {
  color: var(--mfc-ok);
}

#userFilesSelectModal .mfc-sign-app__status--warn {
  color: var(--mfc-warn);
}

#userFilesSelectModal .mfc-sign-app__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

#userFilesSelectModal .mfc-select {
  padding-right: 8px;
  appearance: auto;
  -webkit-appearance: menulist;
  cursor: pointer;
}

#userFilesSelectModal .mfc-input[aria-invalid="true"] {
  border-color: var(--mfc-danger);
}

#userFilesSelectModal .mfc-review__lead {
  margin: 0 0 14px !important;
  font-size: 14.5px;
  line-height: 1.5;
}

#userFilesSelectModal .mfc-review {
  margin: 0;
  border: 1px solid var(--mfc-border);
  border-radius: 12px;
  overflow: hidden;
}

#userFilesSelectModal .mfc-review__row {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 4px 12px;
  padding: 10px 14px;
}

#userFilesSelectModal .mfc-review__row + .mfc-review__row {
  border-top: 1px solid var(--mfc-border);
}

#userFilesSelectModal .mfc-review dt {
  color: var(--mfc-muted);
  font-size: 13px;
  font-weight: 600;
}

#userFilesSelectModal .mfc-review dd {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

#userFilesSelectModal .mfc-sign-links {
  width: 100%;
  text-align: start;
}

#userFilesSelectModal .mfc-sign-link {
  padding: 10px 12px;
  border: 1px solid var(--mfc-border);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

#userFilesSelectModal .mfc-sign-link__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

#userFilesSelectModal .mfc-review__people {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#userFilesSelectModal .mfc-review__name {
  font-weight: 600;
}

#userFilesSelectModal .mfc-review__email {
  color: var(--mfc-muted);
  font-size: 13px;
}

#userFilesSelectModal .mfc-review__note {
  display: block;
  margin-top: 4px;
  color: var(--mfc-muted);
  font-size: 13px;
}

#userFilesSelectModal .mfc-review__message {
  white-space: pre-wrap;
}

/* ------------------------------------------------------- "Enviar por email" */

#userFilesSelectModal .mfc-field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#userFilesSelectModal .mfc-email__copies {
  font-size: 13px;
  white-space: nowrap;
}

#userFilesSelectModal .mfc-field__hint {
  margin: 5px 0 0 !important;
  color: var(--mfc-muted);
  font-size: 12.5px !important;
  line-height: 1.45;
}

#userFilesSelectModal .mfc-email__error {
  margin: 6px 0 0 !important;
}

/* The attachment: the file as the recipients get it, and its format. */
#userFilesSelectModal .mfc-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--mfc-border);
  border-radius: 10px;
  background: var(--mfc-surface);
}

#userFilesSelectModal .mfc-attachment__icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 17px;
}

#userFilesSelectModal .mfc-attachment__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#userFilesSelectModal .mfc-segmented {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--mfc-soft);
}

#userFilesSelectModal .mfc-segmented__option {
  position: relative;
  margin: 0;
  border-radius: 7px;
  color: var(--mfc-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

#userFilesSelectModal .mfc-segmented__option > span {
  display: block;
  padding: 5px 12px;
  border-radius: 7px;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#userFilesSelectModal .mfc-segmented__option:hover > span {
  color: var(--mfc-text);
}

#userFilesSelectModal .mfc-segmented__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#userFilesSelectModal .mfc-segmented__option.is-selected > span {
  background: var(--mfc-surface);
  color: var(--mfc-accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14), 0 0 0 1px var(--mfc-border);
}

/* The Abogado Virtual can draft the email instead, in the chat or in a call. */
#userFilesSelectModal .mfc-assistant-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--mfc-accent-soft);
}

#userFilesSelectModal .mfc-assistant-note__icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mfc-surface);
  color: var(--mfc-accent);
  font-size: 16px;
}

#userFilesSelectModal .mfc-assistant-note__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding-top: 1px;
}

#userFilesSelectModal .mfc-assistant-note__text {
  color: var(--mfc-text);
  font-size: 13.5px;
  line-height: 1.5;
}

#userFilesSelectModal .mfc-assistant-note__text strong {
  font-weight: 700;
}

#userFilesSelectModal .mfc-assistant-note .mfc-btn--soft {
  background: var(--mfc-surface) !important;
}

#userFilesSelectModal .mfc-review__from,
#userFilesSelectModal .mfc-review__file {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 600;
}

#userFilesSelectModal .mfc-review__from img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

#userFilesSelectModal .mfc-review__file .anticon {
  color: var(--mfc-muted);
}

#userFilesSelectModal .mfc-review__empty {
  color: var(--mfc-muted);
  font-style: italic;
}

/* The copy button of each file card (shown only where the feature is on). */
#userFilesSelectModal[data-mfc-export="on"] #user-files .file-card-action.cloud-copy-file {
  display: flex;
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 575.98px) {
  #userFilesSelectModal .mfc-band {
    padding: 0.85em 0.85em 0.8em;
  }

  #userFilesSelectModal .mfc-band__action {
    flex-basis: 100%;
  }

  #userFilesSelectModal .mfc-band__action .mfc-btn {
    width: 100%;
    min-height: 44px;
  }

  #userFilesSelectModal .mfc-band__apps,
  #userFilesSelectModal .mfc-band__foot {
    padding-left: 0;
  }

  #userFilesSelectModal .mfc-dialog,
  #userFilesSelectModal .mfc-dialog.mfc-picker,
  #userFilesSelectModal .mfc-dialog.mfc-picker[data-mode="folder"],
  #userFilesSelectModal .mfc-dialog.mfc-export,
  #userFilesSelectModal .mfc-dialog.mfc-email,
  #userFilesSelectModal .mfc-dialog.mfc-sign {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  /* Three buttons of the email review: sending comes first, on its own row,
     and the other two share the next one. */
  #userFilesSelectModal .mfc-email .mfc-foot__actions {
    flex-wrap: wrap;
  }

  #userFilesSelectModal .mfc-email .mfc-foot__actions .mfc-btn {
    padding: 0 10px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  #userFilesSelectModal .mfc-email .mfc-foot__actions [data-mfc-action="email-send"] {
    flex-basis: 100%;
    order: -1;
  }

  #userFilesSelectModal .mfc-dialog__head {
    padding: 12px 10px 12px 16px;
  }

  #userFilesSelectModal .mfc-picker__bar {
    padding: 10px 14px 8px;
  }

  #userFilesSelectModal .mfc-tabs {
    width: 100%;
  }

  #userFilesSelectModal .mfc-tab {
    flex: 1 1 0;
  }

  #userFilesSelectModal .mfc-search {
    flex-basis: 100%;
  }

  #userFilesSelectModal .mfc-crumbs {
    padding: 0 14px 6px;
  }

  #userFilesSelectModal .mfc-crumbs__item:not(:last-child) {
    display: none;
  }

  #userFilesSelectModal .mfc-crumbs__item + .mfc-crumbs__item::before {
    content: none;
  }

  #userFilesSelectModal .mfc-picker__body {
    padding: 0 6px 10px;
    min-height: 0;
  }

  #userFilesSelectModal .mfc-picker__notice {
    margin: 0 14px 8px;
  }

  #userFilesSelectModal .mfc-dialog__foot {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }

  #userFilesSelectModal .mfc-foot__info {
    flex-basis: 100%;
  }

  #userFilesSelectModal .mfc-foot__actions {
    width: 100%;
  }

  #userFilesSelectModal .mfc-foot__actions .mfc-btn {
    flex: 1 1 0;
    min-height: 44px;
  }

  #userFilesSelectModal .mfc-tray__row {
    padding: 0.7em 0.85em;
  }

  #userFilesSelectModal .mfc-tray__row:has(.mfc-tray__actions .mfc-btn) .mfc-tray__main {
    flex-basis: calc(100% - 2.5em);
  }

  #userFilesSelectModal .mfc-tray__row:has(.mfc-tray__actions .mfc-btn) .mfc-tray__actions {
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: 2.5em;
  }

  #userFilesSelectModal .mfc-tray__head {
    flex-wrap: wrap;
    row-gap: 0.5em;
  }

  #userFilesSelectModal .mfc-tray__copy {
    flex: 1 1 calc(100% - 2.5em);
  }

  #userFilesSelectModal .mfc-tray__head .mfc-btn {
    margin-left: 2em;
  }

  #userFilesSelectModal .mfc-dialog__title {
    font-size: 16px !important;
  }

  #userFilesSelectModal .mfc-export__body {
    padding: 16px 16px 12px;
  }

  #userFilesSelectModal .mfc-signer {
    grid-template-columns: 24px minmax(0, 1fr) 30px;
    row-gap: 6px;
  }

  #userFilesSelectModal .mfc-signer [data-mfc-signer-email] {
    grid-column: 2;
    grid-row: 2;
  }

  #userFilesSelectModal .mfc-signer--email-only [data-mfc-signer-email] {
    grid-row: 1;
  }

  #userFilesSelectModal .mfc-signer > .mfc-icon-btn,
  #userFilesSelectModal .mfc-signer__spacer {
    grid-column: 3;
    grid-row: 1;
  }

  #userFilesSelectModal .mfc-review__row {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (prefers-reduced-motion: reduce) {
  #userFilesSelectModal .mfc-progress.is-indeterminate > span,
  #userFilesSelectModal .mfc-skeleton__row span,
  #userFilesSelectModal .mfc-tray:not(.is-finished) .mfc-tray__icon .anticon {
    animation: none;
  }

  #userFilesSelectModal .mfc-sign-app {
    transition: none;
  }

  #userFilesSelectModal .mfc-sign-app:not(.is-selected):not(.is-locked):hover {
    transform: none;
  }
}
