:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --border: #e1e1e5;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --accent: #ed1c24;
  --accent-hover: #c1131a;
  --accent-soft: #fdecec;
  --error: #c62828;
  --success: #1e7e34;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.04), 0 1px 8px rgba(20, 20, 30, 0.03);
  --shadow-md: 0 4px 16px rgba(20, 20, 30, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  /* Columna a pantalla completa para que el footer quede a la vista al pie
     incluso en paginas cortas como el login. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  position: relative;
}

/* Foto de fondo al azar (public/img/login-bg/), si hay alguna cargada. Sin
   background-image seteado (carpeta vacia) queda igual que antes: el
   fondo solido de --bg del body. Va sin z-index negativo a proposito: el
   background del <body> se "promueve" al canvas de la pagina y se pinta
   por debajo de cualquier elemento con z-index negativo, asi que un
   z-index negativo aca dejaria esta capa siempre invisible. Alcanza con
   que quede primera en el DOM (antes de .page-center) para pintarse detras.*/
.login-bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(245, 245, 247, 0.55);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.auth-brand img {
  width: 34px;
  height: 34px;
}

.brand-word {
  font-weight: 800;
  color: #e70505;
  letter-spacing: -0.02em;
}

.auth-brand .brand-word {
  font-size: 1.4rem;
}

.brand-word .accent {
  color: var(--text);
  font-weight: 300;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  width: 100%;
  max-width: 380px;
}

.card h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
}

.card .subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.9rem;
}

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--muted);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  margin-bottom: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.password-field {
  position: relative;
  margin-bottom: 16px;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  margin-bottom: 0;
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px 8px;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
}

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s, transform 0.05s;
}

button.primary {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-hover);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-footer {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.form-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.form-footer a:hover {
  text-decoration: underline;
}

.error-box {
  background: #fdecea;
  color: var(--error);
  border: 1px solid #f5c6cb;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.error-box.visible {
  display: block;
}

/* --- Topbar / navegacion --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar .brand img {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.provider-badge {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s;
}

.provider-badge:hover {
  background: #fbdada;
}

.topbar .user-email {
  color: var(--muted);
  font-size: 0.85rem;
}

button.link-button {
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 500;
}

button.link-button:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

main.container {
  /* width:100% + min-width:0 son necesarios porque el <body> es un
     contenedor flex en columna: sin ellos, un item con contenido ancho
     (nombres de archivo largos, emails) resuelve su ancho a max-content y
     desborda la pantalla en el celular en vez de encogerse. */
  width: 100%;
  min-width: 0;
  max-width: 720px;
  margin: 40px auto;
  padding: 0 24px;
}

main.container-wide {
  max-width: 960px;
}

main.container h2 {
  letter-spacing: -0.01em;
}

.hero-empty {
  text-align: center;
  padding: 64px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 24px;
}

.hero-empty img {
  border-radius: 12px;
  margin-bottom: 16px;
}

.hero-empty h2 {
  margin: 0 0 8px;
}

.hero-empty p {
  color: var(--muted);
  margin: 0 0 20px;
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.explorer-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.select-all-label input {
  margin: 0;
  width: auto;
}

.entry-select {
  flex-shrink: 0;
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.95rem;
}

.breadcrumb button {
  background: none;
  color: var(--accent);
  padding: 3px 6px;
  font-weight: 500;
  border-radius: 6px;
}

.breadcrumb button:not(:disabled):hover {
  background: var(--accent-soft);
}

.breadcrumb button:disabled {
  color: var(--text);
  font-weight: 600;
  cursor: default;
}

/* El primer segmento del breadcrumb es "Inicio": se muestra como un boton
   claro (chip con borde) para que se note que es la accion de volver al
   inicio, en vez de leerse como texto plano. */
.breadcrumb button:first-child {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 5px 12px;
  font-weight: 600;
}

/* En la raiz, "Inicio" queda deshabilitado (es la ubicacion actual) pero
   sigue viendose como boton. */
.breadcrumb button:first-child:disabled {
  color: var(--accent);
  opacity: 0.9;
}

.breadcrumb button:first-child:not(:disabled):hover {
  background: var(--accent);
  color: #fff;
}

.breadcrumb .sep {
  color: var(--muted);
}

.new-folder-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.new-folder-form input {
  margin: 0;
  padding: 8px 10px;
  width: 220px;
}

.instructions-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin: 4px 0 16px;
}

.instructions-form-intro {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.instructions-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.instructions-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.instructions-form input,
.instructions-form textarea {
  margin: 0;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
}

.instructions-form textarea {
  resize: vertical;
  min-height: 44px;
}

.instructions-form input:focus,
.instructions-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.instructions-form-message {
  position: relative;
}

.instructions-charcount {
  align-self: flex-end;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.instructions-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.instructions-feedback {
  font-size: 0.83rem;
}

.instructions-feedback.is-success {
  color: var(--success);
}

.instructions-feedback.is-error {
  color: var(--error);
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 16px 0;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.upload-item-name {
  flex: 0 0 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.upload-item-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

.upload-item-status {
  flex: 0 0 90px;
  color: var(--muted);
  text-align: right;
}

.upload-item.is-error .upload-item-status {
  color: var(--error);
}

.upload-item.is-error .upload-item-bar-fill {
  background: var(--error);
}

.upload-item.is-done .upload-item-status {
  color: var(--success);
}

.entry-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.entry-row:last-child {
  border-bottom: none;
}

.entry-row.is-folder {
  cursor: pointer;
}

.entry-row.is-folder:hover {
  background: var(--bg);
}

.entry-icon {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.entry-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
}

.entry-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-size {
  color: var(--muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.entry-download {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
}

.entry-download:hover {
  background: var(--accent-soft);
}

.entry-delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--error);
  cursor: pointer;
  font-size: 0.95rem;
}

.entry-delete:hover {
  background: #fdecea;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* --- Dialogo "Instrucciones de uso" --- */
.usage-dialog {
  width: min(560px, 92vw);
  max-height: 85vh;
  border: none;
  border-radius: var(--radius);
  padding: 0;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.usage-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.usage-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.usage-dialog-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.usage-dialog-close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.usage-dialog-close:hover {
  background: var(--bg);
  color: var(--text);
}

.usage-list {
  margin: 0;
  padding: 16px 20px 6px;
  list-style: none;
  overflow-y: auto;
  max-height: 60vh;
}

.usage-list li {
  position: relative;
  padding: 0 0 14px 24px;
  line-height: 1.5;
  font-size: 0.92rem;
  color: var(--text);
}

.usage-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.usage-list strong {
  font-weight: 600;
}

/* Los ejemplos (ej. "10x15") van resaltados como un chip suave. */
.usage-list em {
  font-style: normal;
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.9em;
}

.usage-dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6f4ea;
  color: var(--success);
  margin-left: 8px;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  /* Borde para que el boton se distinga tambien sobre fondos del mismo tono
     que --bg (si no, se lee como texto plano, p. ej. a ancho completo en el
     celular). */
  border: 1px solid var(--border);
  padding: 8px 14px;
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-primary-sm {
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
}

.btn-primary-sm:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: #fdecea;
  color: var(--error);
  padding: 8px 14px;
}

.btn-danger:hover {
  background: #fbdada;
}

a.btn-primary-sm {
  text-decoration: none;
  display: inline-block;
}

.success-box {
  background: #e6f4ea;
  color: var(--success);
  border: 1px solid #b7dfc0;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-top: 16px;
}

/* --- Aviso de subida y aceptacion de terminos --- */

.upload-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
  margin: 16px 0 10px;
}

.upload-notice strong {
  color: var(--accent-hover);
}

/* --- Terminos y condiciones --- */

.terms-content {
  max-width: 760px;
}

.terms-content .updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -8px 0 24px;
}

.terms-content h2 {
  margin: 32px 0 12px;
  font-size: 1.15rem;
}

.terms-content h2:first-of-type {
  margin-top: 8px;
}

.terms-content p {
  margin: 0 0 16px;
  line-height: 1.6;
  color: var(--text);
}

/* --- Footer --- */

.site-footer {
  margin-top: 48px;
  background: #e70505;
  color: #fff;
  padding: 32px 24px 20px;
  /* Por encima del fondo fijo del login (.login-bg), que es un elemento
     posicionado y sino pintaria su velo claro sobre el footer. */
  position: relative;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

.footer-col .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 8px;
}

.footer-col .brand img {
  width: 22px;
  height: 22px;
  /* El logo tiene fondo transparente; sobre el footer rojo necesita un
     circulo blanco detras para que el rojo y el gris del logo se lean. */
  background: #fff;
  border-radius: 50%;
}

/* Sobre el fondo rojo el wordmark va todo en blanco. */
.site-footer .brand-word,
.site-footer .brand-word .accent {
  color: #fff;
}

.footer-col h4 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.8);
}

.footer-col p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.5;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 9px;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-address {
  margin-bottom: 10px;
}

/* Cards blancas del footer (enlaces + mapa): sobre el fondo rojo del footer
   resaltan como tarjetas con el icono de marca a la izquierda. */
.footer-card,
.footer-map-card {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px 13px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s, box-shadow 0.15s;
}

.footer-card {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 9px;
}

.footer-card:last-child {
  margin-bottom: 0;
}

.footer-card:hover,
.footer-map-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
}

.footer-card-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
}

.footer-map-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: block;
}

.footer-map-text {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-map-text strong {
  color: var(--text);
  font-size: 0.9rem;
}

.footer-bottom {
  max-width: 960px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  text-align: center;
}

/* --- Responsive / celulares --- */

/* Red de seguridad global: ninguna imagen debe forzar scroll horizontal.
   Las reglas por clase (miniaturas, logos) tienen mayor especificidad, asi
   que conservan su tamano fijo; solo se ven afectadas las imagenes sueltas. */
img {
  max-width: 100%;
  height: auto;
}

/* Strings sin espacios (emails, nombres de archivo largos) se parten en vez
   de estirar el layout mas alla del ancho de la pantalla. */
.breadcrumb button,
.footer-link,
.footer-map-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 14px;
    gap: 8px 12px;
  }

  .topbar-right {
    gap: 6px 10px;
  }

  /* El email puede ser largo y no tiene espacios donde cortar: se recorta
     con puntos suspensivos para que no empuje el boton de cerrar sesion. */
  .topbar .user-email {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-links a {
    padding: 6px 9px;
    font-size: 0.85rem;
  }

  main.container {
    margin: 24px auto;
    padding: 0 16px;
  }

  /* Las acciones del explorador pasan a una fila propia a ancho completo,
     con los botones repartiendose el espacio en vez de desbordar. */
  .explorer-toolbar-actions {
    width: 100%;
  }

  .explorer-toolbar-actions .btn-primary-sm,
  .explorer-toolbar-actions .btn-secondary {
    flex: 1 1 auto;
    text-align: center;
  }

  /* La barra de nueva carpeta apila el input a ancho completo sobre los
     botones (antes el input fijo de 220px podia desbordar). */
  .new-folder-form {
    flex-wrap: wrap;
  }

  .new-folder-form input {
    width: 100%;
    flex: 1 1 100%;
  }

  .new-folder-form button {
    flex: 1 1 auto;
  }

  .instructions-form {
    padding: 14px;
  }

  .instructions-form-grid {
    grid-template-columns: 1fr;
  }

  .instructions-form-actions .btn-primary-sm,
  .instructions-form-actions .btn-secondary {
    flex: 1 1 auto;
  }

  .instructions-feedback {
    flex-basis: 100%;
  }

  /* Filas del explorador: menos gap/padding para que entren miniatura,
     nombre y botones de accion sin apretarse en pantallas chicas. */
  .entry-row {
    gap: 8px;
    padding: 10px 12px;
  }

  /* El item de subida apila nombre / barra / estado en vez de forzar una
     sola fila mas ancha que la pantalla. */
  .upload-item {
    flex-wrap: wrap;
  }

  .upload-item-name {
    flex: 1 1 100%;
  }

  .site-footer {
    padding: 26px 16px 18px;
  }

  .footer-inner {
    gap: 22px;
  }
}

/* Pantallas muy angostas: el email del topbar suele ser lo que mas empuja,
   se esconde (la cuenta ya se ve en Administrador / Conectar). */
@media (max-width: 380px) {
  .topbar .user-email {
    display: none;
  }
}
