body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Paleta x/y variables de diseño (tema claro) */
:root {
    --color-bg: #f4f4f4;
    --color-surface: #ffffff;
    --color-text: #111827;
    --color-muted: #4b5563;
    --color-border: #e5e7eb;
    --color-header-bg: #35424a;
    --color-header-text: #ffffff;
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-accent: #374151;
}

html, body { background: var(--color-bg); color: var(--color-text); }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

header {
    background: var(--color-surface); /* fondo claro */
    color: var(--color-text); /* texto oscuro para contraste */
    text-align: center;
    border-bottom: 2px solid #e8491d; /* línea roja */
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
}

/* Tabs navigation */
.main-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px; background: var(--color-surface); }
.main-nav .tab { text-decoration: none; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--color-border); background: #fff; color: var(--color-text); font-weight: 600; }
.main-nav .tab:hover { border-color: var(--color-primary); }
.main-nav .tab.active { border-color: var(--color-primary); color: var(--color-primary); }
/* Hacer que la pestaña activa "toque" el contenido (superpone la línea roja) */
.main-nav .tab.active { border-bottom-color: #fff; margin-bottom: -2px; position: relative; z-index: 1; background: #fff; }
@media (min-width: 900px) {
  .main-nav { gap: 0; }
  .main-nav .tab { border-radius: 8px 8px 0 0; border-bottom: none; margin-right: 6px; background: var(--color-surface); }
  .main-nav .tab.active { background: #fff; }
}

/* Fondo blanco en el contenido para continuidad visual con la pestaña activa */
main { background: var(--color-surface); }

/* Logo en el header */
header .logo {
    height: 144px;
    width: auto;
    display: block;
    object-fit: contain;
}

h1 {
    margin: 0;
}

header h1 {
    margin: 0;
}

header .acciones {
    display: flex;
    gap: 15px; /* Espacio entre los botones */
}
/* Evita que las reglas genéricas de .acciones alteren el header */
header .acciones { flex-direction: row; flex-wrap: wrap; }
/* En pantallas grandes, los botones del header no ocupan ancho completo */
@media (min-width: 601px) {
  header .acciones .boton-accion {
    width: auto;
    max-width: none;
    flex: 0 0 auto; /* tamaño según contenido */
    min-width: 44px; /* tamaño mínimo táctil */
  }
}

/* Botón principal del header con fondo claro */
header .boton-accion.boton-primario {
  background: #fff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
header .boton-accion.boton-primario:hover {
  background: #f9fafb;
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: none;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

#task-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
}
/* Cuando se filtra a una sola columna, ocupar todo el ancho en cualquier breakpoint */
#task-container.single-column { grid-template-columns: 1fr !important; }
/* Cuando se filtran exactamente dos columnas, que ambas ocupen todo el ancho */
#task-container.two-columns { grid-template-columns: repeat(2, 1fr) !important; }
/* Cuando se filtran exactamente tres columnas, ocupar el ancho con tres tracks */
#task-container.three-columns { grid-template-columns: repeat(3, 1fr) !important; }
/* Grupo de checkboxes de columnas */
.filter-columns { display: inline-flex; flex-wrap: wrap; gap: 10px; margin-left: 12px; align-items: center; }
.filter-column-actions .boton-accion { padding: 6px 10px; }
@media (max-width: 699px) {
  #task-container {
    grid-template-columns: 1fr;
  }
}

/* Estilo normal de la categoría */
.category {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease, transform 0.05s ease;
    min-width: 0;
}
.category:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.08); }

.category h2 {
    margin-top: 0;
}

/* Estilo cuando se está arrastrando una tarea encima */
.category.drag-over { border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(53,66,74,0.15) inset; }

.category h3 {
    margin: 0 0 12px 0;
    font-size: 1.05rem;
    color: var(--color-text);
    border-left: 4px solid var(--color-primary);
    padding-left: 8px;
}

.task {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    padding: 10px 10px 10px 12px;
    margin: 8px 0;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    /* Mostrar acciones debajo del texto también en escritorio */
    flex-wrap: wrap;
}
.task .task-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  /* Ocupa toda la línea superior para que el texto tenga ancho completo */
  flex-basis: 100%;
}
.task .task-actions {
  /* Ocupa una nueva línea bajo el contenido principal */
  flex-basis: 100%;
  width: 100%;
  margin-left: 0;
  margin-top: 6px;
  /* Dos selects + 3 botones en una fila cuando haya espacio */
  display: grid;
  /* orden (flexible), mover, Hecho, editar, dividir, eliminar */
  grid-template-columns: 1fr auto auto auto auto auto;
  column-gap: 8px;
  align-items: center;
  overflow: visible;
}
.task .task-actions > * {
  flex: 0 0 auto; /* no encoger controles */
}
.task:hover { background: #f3f4f6; }


.task span {
    flex: 1 1 auto;
    /* Permitir que el contenido se encoja en contenedores flex */
    min-width: 0;
    text-align: left !important;
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.35;
    /* Evitar que URLs largas desborden el ancho en móvil */
    overflow-wrap: anywhere; /* permite cortes en cualquier punto si es necesario */
    word-break: break-word;  /* compatibilidad con navegadores más antiguos */
}
.task a {
  color: var(--color-primary);
  text-decoration: underline;
  /* Asegurar que los enlaces muy largos también se partan en varias líneas */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task.completed { opacity: 0.75; border-left-color: #86efac; }

button {
    background: #374151; /* slate 700 */
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
}

button:hover { background: #1f2937; }

/* Botones dentro de cada tarea: estilo sutil y sin fondo sólido */
.task .edit-btn,
.task .delete-btn,
.task .split-btn,
.task .done-btn {
  background: transparent;
  color: var(--color-muted);
  border: none;
  padding: 6px 8px;
}
.task .btn-label { display: none; }
.task .edit-btn:hover,
.task .split-btn:hover { color: var(--color-primary); }
.task .delete-btn:hover { color: #dc2626; }
.task .done-btn:hover { color: #16a34a; }

/* Botón de deshacer en histórico */
.task .history-delete {
  background: transparent;
  color: var(--color-muted);
  border: none;
  padding: 6px 8px;
}
.task .history-delete:hover { color: #dc2626; }

.task select {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 120px; /* asegura visibilidad del selector */
}
/* Hacer que el selector dentro de acciones ocupe todo el ancho disponible */
.task .task-actions select {
  width: 100%;
  min-width: 0;
}

.task .tags { display: block; margin-top: 4px; }
.tag-chip.in-task {
  background: #eef2f7;
  color: #374151;
  border: 1px solid #d1d5db;
}
/* Metadatos de recordatorio/archivo */
.task .reminder-meta,
.task .archived-meta,
.task .done-meta {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 12px;
}
/* Adjuntos dentro de la tarjeta */
.attachments { margin-top: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-width: 100%; }
.attachment-img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--color-border); background: #fff; display: block; }
.attachment-video { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--color-border); background: #000; display: block; max-width: 100%; }
.attachment-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; color: var(--color-text); text-decoration: none; }
.attachment-file:hover { border-color: var(--color-primary); }
.attachment-wrap { display: inline-flex; align-items: center; gap: 6px; }
.attachment-dl { display: inline-block; padding: 4px 6px; border: 1px solid var(--color-border); border-radius: 6px; background: #fff; text-decoration: none; color: var(--color-text); }
.attachment-dl:hover { border-color: var(--color-primary); }

/* Audio/Video attachments: controls below the player */
.attachment-audio-wrap, .attachment-video-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; max-width: 100%; min-width: 0; }
.attachment-audio { width: 100%; max-width: 100%; height: 32px; }
.attachment-video { width: 100%; max-width: 100%; height: auto; }
.media-controls { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.attachment-audio-wrap .audio-restart,
.attachment-audio-wrap .audio-speed button,
.attachment-audio-wrap .audio-loop-toggle,
.attachment-video-wrap .video-restart,
.attachment-video-wrap .video-speed button,
.attachment-video-wrap .video-loop-toggle {
  background: #fff; color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1;
  font-size: 12px;
}
.attachment-audio-wrap .audio-ab-a,
.attachment-audio-wrap .audio-ab-b,
.attachment-video-wrap .video-ab-a,
.attachment-video-wrap .video-ab-b {
  background: #fff; color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1;
  font-size: 12px;
}
.attachment-audio-wrap .audio-speed,
.attachment-video-wrap .video-speed { display: inline-flex; align-items: center; gap: 4px; }
.attachment-audio-wrap .audio-speed-label,
.attachment-video-wrap .video-speed-label { font-size: 14px; min-width: 36px; text-align: center; color: var(--color-muted); }

/* Estado activo del bucle */
.attachment-audio-wrap .audio-loop-toggle.active,
.attachment-audio-wrap .audio-loop-toggle[aria-pressed="true"],
.attachment-video-wrap .video-loop-toggle.active,
.attachment-video-wrap .video-loop-toggle[aria-pressed="true"] {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Estado activo del A–B */
.attachment-audio-wrap .audio-ab-toggle.active,
.attachment-audio-wrap .audio-ab-toggle[aria-pressed="true"],
.attachment-video-wrap .video-ab-toggle.active,
.attachment-video-wrap .video-ab-toggle[aria-pressed="true"] {
  background: #10b981; /* verde distinto para diferenciar */
  color: #fff;
  border-color: #10b981;
}

/* Punto A/B marcados visualmente */
.attachment-audio-wrap .audio-ab-a.marked,
.attachment-audio-wrap .audio-ab-b.marked,
.attachment-video-wrap .video-ab-a.marked,
.attachment-video-wrap .video-ab-b.marked {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
/* Alternativa por aria-pressed */
.attachment-audio-wrap .audio-ab-a[aria-pressed="true"],
.attachment-audio-wrap .audio-ab-b[aria-pressed="true"],
.attachment-video-wrap .video-ab-a[aria-pressed="true"],
.attachment-video-wrap .video-ab-b[aria-pressed="true"] {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* En la cuadrícula de adjuntos de las tarjetas, que el audio ocupe todo el ancho */
.attachments > .attachment-audio-wrap { grid-column: 1 / -1; }
.attachments > .attachment-video-wrap { grid-column: 1 / -1; }
.attachments > .attachment-video { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .attachment-audio { height: 28px; }
  /* Controles más compactos en móvil */
  .attachment-audio-wrap .audio-restart,
  .attachment-audio-wrap .audio-speed button,
  .attachment-video-wrap .video-restart,
  .attachment-video-wrap .video-speed button {
    padding: 4px 6px; /* reducir ancho */
    font-size: 38px;
    min-height: 30px;
    min-width: 32px; /* evitar botones muy anchos */
    width: auto;
    white-space: nowrap;
  }
  .attachment-audio-wrap .audio-speed-label,
  .attachment-video-wrap .video-speed-label {
    font-size: 12px;
    min-width: 28px;
  }
  .video-controls,
  .audio-controls { gap: 8px; }
}

/* En el modal de adjuntos, dejar que el audio se estire también */
.popup-attachments .attachment-row { width: 100%; }
.popup-attachments .attachment-audio-wrap { flex: 1 1 auto; }
.popup-attachments .attachment-audio { flex: 1 1 auto; }
/* Botón eliminar en el modal */
.popup-attachments .attachment-row { display:flex; align-items:center; gap:8px; }
.popup-attachments .attachment-remove { background:#eee; color:#333; border:1px solid var(--color-border); border-radius:6px; padding:4px 8px; cursor:pointer; }
.popup-attachments .attachment-remove:hover { background:#dc2626; color:#fff; border-color:#dc2626; }
/* Destacar recordatorios vencidos en la vista de recordatorios */
.category.overdue .task .reminder-meta {
  color: #dc2626; /* rojo para vencidos */
}

footer {
    text-align: center;
    padding: 10px 0;
    background: var(--color-header-bg);
    color: var(--color-header-text);
    position: relative;
    bottom: 0;
    width: 100%;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(175, 163, 163, 0.4);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: #e7dede;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 720px;
    margin: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#admin-modal .modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

.atajos-modal-content {
    background: #ffffff;
    color: var(--color-text);
}

.keyboard-shortcuts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.keyboard-shortcuts li {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--color-surface);
}

.shortcut-keys {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.shortcut-keys kbd {
    background: var(--color-header-bg);
    color: var(--color-header-text);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 28px;
    text-align: center;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.shortcut-plus {
    font-weight: 600;
    color: var(--color-muted);
}

.shortcut-desc {
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

#atajos-modal .acciones-popup {
    margin-top: 20px;
}

/* Texto del modal de confirmación */
.confirm-message {
  color: var(--color-text);
  font-size: 1rem;
}

/* Acciones del modal (reutiliza .acciones-popup) */
.modal .acciones-popup button {
  min-width: 110px;
}

/* Inputs y selects consistentes */
input[type="text"],
input[type="url"],
input[type="password"],
select,
textarea {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
}

/* Área de descripción más amplia para nuevas actividades */
#popup-task-name {
  width: 95%;
  min-height: 120px;
  resize: vertical;
  font-size: 1.05rem;
  line-height: 1.35;
}

/* Área de etiquetas más amplia */
#popup-task-tags {
  width: 95%;
  min-height: 6px;
  resize: vertical;
  font-size: 1rem;
  line-height: 1;
}

.boton-accion {
    margin-bottom: 12px;
    width: 100%;
    max-width: 350px;
    font-weight: 600;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    display: inline-flex; /* Para alinear el icono y el texto */
    align-items: center;
    gap: 8px; /* Espacio entre icono y texto */
    border: 1px solid transparent;
    box-sizing: border-box;
    text-decoration: none; /* Para <a> con estilo de botón */
    min-height: 44px; /* Altura táctil consistente */
    justify-content: center; /* Centrar contenido horizontalmente */
}

/* Estilo para el botón de acción principal */
.boton-primario {
    background-color: var(--color-primary);
    color: rgb(157, 106, 106);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.boton-primario:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

/* Estilo para el botón de acción secundario */
.boton-secundario {
    background-color: #a06969;
    color: #333;
    border-color: #ddd;
}
.boton-secundario:hover {
    background-color: #976c6c;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Para los botones de copia de seguridad */
.acciones {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 350px;
    margin: 0 auto 20px auto;
}

/* Para los botones del popup */
.acciones-popup {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

@media (min-width: 500px) {
    .acciones-popup {
        flex-direction: row;
        justify-content: flex-end;
        gap: 16px;
    }
}

@media (max-width: 600px) {

    
   
    /* En móvil, ocultar texto y dejar solo iconos */
    .task .btn-label { display: none; }
    .header-top { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 10px;
        text-align: left;
    }
    header h1 { margin-bottom: 6px; }
    header .acciones { 
        width: 100%; 
        justify-content: center; 
        gap: 10px; 
        flex-direction: column;
    }
    header .acciones .boton-accion { 
        width: 100%; 
        max-width: 100%; 
    }

    .container {
        width: 98%;
        padding: 0 1%;
    }
    form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    input[type="text"], button {
        width: 100%;
        box-sizing: border-box;
        font-size: 1.1em;
    }
    /* Separar el filtro del borde en móvil */
    #filter-tag-label, #filter-tag {
        margin-left: 12px;
        margin-right: 12px;
    }
    #filter-tag-label { display: inline-block; margin-bottom: 6px; }
    /* Poner controles de columnas en nueva línea en móvil */
    #filter-column-label { display: block; margin: 10px 12px 4px 12px !important; }
    .filter-columns { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 12px; }
    .filter-column-actions { display: flex; gap: 8px; margin: 6px 12px 0 12px !important; }
    .boton-accion {
        font-size: 1.1em;
        margin-bottom: 18px;
    }

    /* Colocar el popup de añadir tarea en la parte superior en móviles */
    #popup-tarea {
        align-items: flex-start; /* alinear arriba */
        padding-top: 12px;       /* pequeño margen desde el borde superior */
        overflow-y: auto;        /* permitir scroll si el contenido crece */
    }
    #popup-tarea .modal-content {
        margin: 12px auto 20px;  /* evitar margen auto vertical que centra */
        width: 94%;              /* un poco más ancho en móvil */
        max-width: 560px;        /* tope razonable en móvil */
    }
}

/* En pantallas >600px mantener todas las acciones en una fila */
@media (min-width: 601px) {
  .task .task-actions select {
    width: auto;
    min-width: 140px;
  }
}

/* Estilos para Notificaciones Toast */
.toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 30px;
    font-size: 17px;
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
}

.toast.show {
    visibility: visible;
    opacity: 1;
}

.toast.success {
    background-color: #4CAF50; /* Verde */
}

.toast.error {
    background-color: #f44336; /* Rojo */
}

.controles-principales {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background-color: #b1a4a4;
    border-top: 1px solid #eee;
    justify-content: center;
}
.grupo-botones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sync-provider {
    border: 1px solid #dce3ef;
    border-radius: 10px;
    padding: 12px 14px;
    background: #f9fbff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-provider h4 {
    margin: 0;
    font-size: 15px;
    color: #2d3a43;
}

.sync-helper {
    margin: 0;
    font-size: 13px;
    color: #5a6b78;
}

.sync-provider label {
    font-size: 13px;
    font-weight: 600;
    color: #44515b;
}

.sync-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.sync-actions .boton-accion {
    flex: 1 1 180px;
    margin-bottom: 0;
    width: auto;
    max-width: none;
}

.sync-status {
    min-height: 20px;
    font-size: 13px;
    color: #4b5563;
}
.sync-status.status-success { color: #166534; }
.sync-status.status-error { color: #b91c1c; }
.sync-status.status-warning { color: #92400e; }

/* Chips de etiquetas rápidas */
.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.tag-chip {
    background: #eef2f7;
    color: #35424a;
    border: 1px solid #cfd8e3;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}
.tag-chip.selected {
    background: #35424a;
    color: white;
    border-color: #35424a;
}
.grupo-botones h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #555;
}
.boton-peligro {
    background-color: #d9534f;
    color: white;
    border-color: #d43f3a;
}
.boton-peligro:hover {
    background-color: #c9302c;
    border-color: #ac2925;
}

/* Layout fluido en escritorio: el contenido ocupa todo el ancho */
/* Indicador de reconexión Dropbox */
#reconnect-indicator {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  background: #fde68a; /* amber-200 */
  color: #7c2d12; /* amber-900 */
  text-align: center;
  padding: 8px 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-weight: 600;
}
.image-lightbox {
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
}
.image-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.attachment-img { cursor: zoom-in; }

/* Panel de reutilización de adjuntos en el modal */
.reuse-panel { margin-top: 8px; border: 1px dashed var(--color-border); padding: 8px; border-radius: 8px; background: #fafafa; max-height: 50vh; overflow: auto; }
.reuse-panel .reuse-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; position: sticky; top: 0; background: #fafafa; padding-top: 4px; padding-bottom: 4px; }
.reuse-panel .reuse-controls input { flex: 1 1 auto; }
.reuse-panel .reuse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.reuse-item { border: 1px solid var(--color-border); background: #fff; border-radius: 8px; padding: 6px; display:flex; flex-direction: column; gap:6px; }
.reuse-item .thumb { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid var(--color-border); }
.reuse-item .name { font-size: 12px; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reuse-item .actions { display:flex; justify-content: flex-end; }

/* YouTube embeds responsive */
.yt-embed { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-link a { color: var(--color-muted); font-size: 12px; text-decoration: underline; }
